Skip to content

Instantly share code, notes, and snippets.

@DmitriyShaydurov
Forked from bennadel/insert.sql
Created June 23, 2020 12:19
Show Gist options
  • Save DmitriyShaydurov/443465b27eafc7e6d73e617e6efb24c3 to your computer and use it in GitHub Desktop.
Save DmitriyShaydurov/443465b27eafc7e6d73e617e6efb24c3 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
;
@DmitriyShaydurov
Copy link
Author

DmitriyShaydurov commented Jun 23, 2020

Helps to resolve Atom PHP syntax highlighting issue when writing SQL inside quotes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment