MySQL Workbench: Difference between revisions

From HaFrWiki42
Jump to navigation Jump to search
mNo edit summary
 
Line 10: Line 10:
* Then execute the statement:
* Then execute the statement:
<pre>INSERT INTO `table2` SELECT * FROM `table1`</pre>
<pre>INSERT INTO `table2` SELECT * FROM `table1`</pre>
== Sync Host with local Database ==
* [[Mysql Sync Host]]


== See also ==
== See also ==

Latest revision as of 12:02, 31 May 2026

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`

Sync Host with local Database

See also

top

  • SQL, More SQL statements to remember.

Reference

top