Skip to content

Instantly share code, notes, and snippets.

@bennadel
Created September 17, 2015 11:00
Show Gist options
  • Save bennadel/0beb0bc04bcae9f077dc to your computer and use it in GitHub Desktop.
Save bennadel/0beb0bc04bcae9f077dc to your computer and use it in GitHub Desktop.
Using The INSERT INTO ... SET Syntax In MySQL
-- Create a new friend record.
INSERT INTO
friend
SET
name = 'Kim',
isBFF = true,
updatedAt = UTC_TIMESTAMP()
;
-- Return the newly-generated primary-key.
SELECT
( @@Identity ) AS id
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment