422 solutions found in database
Page 7 of 22votes
I can't quite get a grasp of MySQL's DECIMAL. I need the row to be able to contain a number anywhere from 00.0001 to 99.9999. How would I structure it t...
votes
Here is a gross oversimplification of an intense setup I am working with. `table_1` and `table_2` both have auto-increment surrogate primary keys as the ID. `in...
votes
Is there a way to detect if a value is a number in a MySQL query? Such as SELECT * FROM myTable WHERE isANumber(col1) = true
votes
In MySQL, is there a way to set the "total" fields to zero if they are NULL? Here is what I have: SELECT uo.order_id, uo.order_total, uo.ord...
votes
I am trying to post on an API with some query params. This is working on PostMan / Insomnia when I am trying to by passing mail and firstname as query paramete...
votes
I recently installed MySQL and it seems I have to reset the password after install. It won't let me do anything else. Now I already reset the password th...
votes
What's the best way to do following: SELECT * FROM users WHERE created >= today; Note: created is a datetime field.
votes
In MySQL, can I select columns only where something exists? For example, I have the following query: select phone, phone2 from jewishyellow.user...
votes
The query I'm running is as follows, however I'm getting this error: > \#1054 - Unknown column 'guaranteed_postcode' in 'IN/ALL/ANY subq...
votes
Do you need to explicitly create an index, or is it implicit when defining the primary key? Is the answer the same for MyISAM and InnoDB?
votes
When doing: DELETE FROM `jobs` WHERE `job_id` =1 LIMIT 1 It errors: #1451 - Cannot delete or update a parent row: a foreign key constraint fai...
votes
I knew boolean in mysql as `tinyint (1)`. Today I see a table with defined an integer like `tinyint(2)`, and also others like `int(4)`, `int(6)` ... What...
votes
I need to ALTER my existing database to add a column. Consequently I also want to update the UNIQUE field to encompass that new column. I'm trying to remove...
votes
I am doing `SELECT GROUP_CONCAT(categories SEPARATOR ' ') FROM table`. Sample data below: categories ---------- test1 test2 test3...
votes
What's the simplest (and hopefully not too slow) way to calculate the median with MySQL? I've used `AVG(x)` for finding the mean, but I'm having a h...
votes
I'm designing my database schema using MySQL Workbench, which is pretty cool because you can do diagrams and it converts them :P Anyways, I've decide...
votes
I've recently taken over an old project that was created 10 years ago. It uses MySQL 5.1. Among other things, I need to change the default character...
votes
While starting mysql server 5.7.17 using mysqld_safe, following error occcours. 2017-02-10T17:05:44.870970Z mysqld_safe Logging to '/var/log/mysql/er...
votes
Being new to MySQL, I have installed the latest version of the MySQL Workbench (5.2.33). I would like to know how you can create a database with this applicatio...
votes
I would like to write a script which copies my current database `sitedb1` to `sitedb2` on the same mysql database instance. I know I can dump the sitedb1 to a s...