MySQL Workbench

From HaFrWiki
Jump to: navigation, search

There are sql statements you are using a lot, and there are some you need only once or twice. So I make this my SQL remember place for MySQL Workbench.

Copy Table Structure and Data

Copy a sql table structure and and data into a new table.

  • Right mouse click the table you want to copy
  • Choose, Send to SQL Editor -> Create Statement
  • Select all and execute the statement (lightening bolt icon)
  • In SQL statement, change table name
  • Then execute the statement:
INSERT INTO `table2` SELECT * FROM `table1`

See also

top

  • SQL, More SQL statements to remember.

Reference

top