Just use SHOW CREATE TABLE SHOW CREATE TABLE my_table See also: How to generate a CREATE TABLE statement for a given table in SQL Server How to generate a CREATE TABLE statement for a given table in Oracle How to generate a CREATE TABLE statement for a given table in SQLite Some MySQL tools you ... Read more
Category Archives: Mysql
Remove duplicate rows in MySQL
The primary key: id, the unique columns: col_1, col_2, col_3 . You can use a temporary table, like: create temporary table temp_table (id int); insert temp_table (id) select id from your_table t1 where exists ( select * from your_table t2 ... Read more
How to get column names from Mysql table
We can use information_schema.columns for getting column information SELECT column_name FROM information_schema.columns WHERE table_schema = ‘My_Schema_Name’ AND table_name = ‘My_Table_Name’ See also: How to get column names from Sql Server table How to get column names ... Read more