422 solutions found in database
Page 12 of 22votes
There are plenty of similar questions to be found on here but I don't think that any answer the question adequately. I'll continue from the current m...
votes
How do I subtract 30 days from the current datetime in mysql? SELECT * FROM table WHERE exec_datetime BETWEEN DATEDIFF(NOW() - 30 days) AND NOW();
votes
I am looking for the syntax to add a column to a MySQL database with a default value of 0 [Reference][1] [1]: http://dev.mysql.com/doc/refman/5.1/en/...
votes
I have a table whose primary key is referenced in several other tables as a foreign key. For example: CREATE TABLE `X` ( `X_id` int NOT NULL...
votes
When should I use `KEY`, `PRIMARY KEY`, `UNIQUE KEY` and `INDEX`?
votes
My iPhone application connects to my PHP web service to retrieve data from a MySQL database, a request can return up to 500 results. What is the best way to...
votes
Tried mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION; Getting > ERROR 1064 (4200...
votes
I'm trying to connect to the local MySQL server but I keep getting an error. Here is the code. public class Connect { public static voi...
votes
Am getting the below error when trying to do a select through a stored procedure in MySQL. > Illegal mix of collations (latin1_general_cs,IMPLICIT) and (l...
votes
I have a whole lot of records where text has been stored in a blob in MySQL. For ease of handling I'd like to change the format in the database to TEXT... A...
votes
I am working on a moderately complex schema in MySQL Workbench, and the single page of the EER diagram is now full up. Does anyone know how to enlarge it to two...
votes
Is a MySQL `SELECT` query case sensitive or case insensitive by default? And if not, what query would I have to send so that I can do something like the followi...
votes
In a [member] table, some rows have the same value for the `email` column. login_id | email ---------|--------------------- john | john123@...
votes
I have a query that looks like this: `SELECT article FROM table1 ORDER BY publish_date LIMIT 20` How does ORDER BY work? Will it order all records, then g...
votes
Is there a MySQL function which can be used to convert a Unix timestamp into a human readable date? I have one field where I save Unix times and now I want to a...
votes
I understand that this question has been asked before, but most of the time it is asked in relation to a specific database or table. I cannot find an answer on...
votes
What is main difference between `INSERT INTO table VALUES ..` and `INSERT INTO table SET`? Example: INSERT INTO table (a, b, c) VALUES (1,2,3)...
votes
I've been trying to figure out how I can make a query with MySQL that checks if the value (string `$haystack` ) in a certain column contains certain data (s...
votes
I have a function that returns five characters with mixed case. If I do a query on this string it will return the value regardless of case. How can I make My...
votes
Is there a query (command) to truncate all the tables in a database in one operation? I want to know if I can do this with one single query.