422 solutions found in database
Page 21 of 22votes
How can I ***reset*** the `AUTO_INCREMENT` of a field? I want it to start counting from `1` again.
votes
Using `MySQL`, I can do something like: SELECT hobbies FROM peoples_hobbies WHERE person_id = 5; **My Output:** shopping fishing codi...
votes
Is there an easy way to run a MySQL query from the Linux command line and output the results in [CSV][1] format? Here's what I'm doing now: ```lan...
votes
I'm using the MySQL command-line utility and can navigate through a database. Now I need to see a list of user accounts. How can I do this? I'm using...
votes
Since MySQL doesn't seem to have any 'boolean' data type, which data type do you 'abuse' for storing true/false information in MySQL? Esp...
votes
There is a table `messages` that contains data as shown below: Id Name Other_Columns ------------------------- 1 A A_data_1 2...
votes
I want to update the column `visited` to give it the value 1. I tried this command in the SQL editor inside MySQL workbench: UPDATE tablename SET columnn...
votes
I can run this query to get the sizes of all tables in a MySQL database: show table status from myDatabaseName; I would like some help in understandin...
votes
I want to add a row to a database table, but if a row exists with the same unique key I want to update the row. For example: ```sql INSERT INTO table_nam...
votes
How do I quickly rename a MySQL database (change its schema name)? Usually I just dump a database and re-import it with a new name. This is not an option for...
votes
I am an old-school MySQL user and have always preferred `JOIN` over sub-query. But nowadays everyone uses sub-query, and I hate it; I don't know why....
votes
I started by googling and found the article *[How to write INSERT if NOT EXISTS queries in standard SQL][1]* which talks about mutex tables. I have a table w...
votes
I have 2-3 different column names that I want to look up in the entire database and list out all tables which have those columns. Is there any easy script?
votes
I have a table: table votes ( id, user, email, address, primary key(id), ); How can I make the columns **user, e...
votes
How do you set a default value for a MySQL Datetime column? In SQL Server it's `getdate()`. What is the equivalant for MySQL? I'm using MySQL 5.x if...
votes
I am trying to select data from a MySQL table, but I get one of the following error messages: > mysql_fetch_array() expects parameter 1 to be resource, bo...
votes
I have a table with a varchar column, and I would like to find all the records that have duplicate values in this column. What is the best query I can use to fi...
votes
I've got a messages table in MySQL which records messages between users. Apart from the typical ids and message types (all integer types) I need to save the...
votes
I have a table of player performance: ``` CREATE TABLE TopTen ( id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, home INT UNSIGNED NOT NULL, `datetime`D...
votes
I have installed PHP 7 and MySQL 5.5.47 on Ubuntu 14.04 (Trusty Tahr). I have checked installed extension using: sudo apt-cache search php7-*...