Skip to content

Instantly share code, notes, and snippets.

@zarpio
Created March 23, 2012 10:05
Show Gist options
  • Save zarpio/2169213 to your computer and use it in GitHub Desktop.
Save zarpio/2169213 to your computer and use it in GitHub Desktop.
mysql quries
/* Copying rows in MySQL */
CREATE TEMPORARY TABLE temp_table
AS
SELECT * FROM source_table WHERE id='15';
UPDATE temp_table SET id='999' WHERE id='15';
INSERT INTO source_table SELECT * FROM temp_table;
DROP TEMPORARY TABLE temp_table;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment