Skip to content

Instantly share code, notes, and snippets.

@0x07dc
Created March 29, 2015 03:44
Show Gist options
  • Save 0x07dc/fc2dfed5f5d63450c6eb to your computer and use it in GitHub Desktop.
Save 0x07dc/fc2dfed5f5d63450c6eb to your computer and use it in GitHub Desktop.
Copy tables in MySQL
# Drawn from http://stackoverflow.com/a/15649857/2016196
# To make a new table
CREATE TABLE YourNewTable
SELECT *
FROM mygrist_tables
WHERE suic_att>=5 AND gender='M';
# To copy to an existing table
INSERT INTO YourNewTable
SELECT *
FROM mygrist_tables
WHERE suic_att>=5 AND gender='M';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment