Skip to content

Instantly share code, notes, and snippets.

@MattMS
Created May 11, 2015 04:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MattMS/7aec763513176a0e9161 to your computer and use it in GitHub Desktop.
Save MattMS/7aec763513176a0e9161 to your computer and use it in GitHub Desktop.
Copy part of a table into a new table.
INSERT INTO other_schema.new_table (id, name, definition)
SELECT old_id, old_name, old_definition
FROM original_schema.current_table
WHERE old_name IS NOT NULL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment