Skip to content

Instantly share code, notes, and snippets.

@Bigcheese
Created March 22, 2015 09:57
Show Gist options
  • Save Bigcheese/dacca33bd0112c17b96a to your computer and use it in GitHub Desktop.
Save Bigcheese/dacca33bd0112c17b96a to your computer and use it in GitHub Desktop.
BEGIN;
BEGIN TRANSACTION;
INSERT INTO urls (url)
SELECT 'sefsefefsves'
WHERE NOT EXISTS (SELECT id FROM urls WHERE urls.url = 'sefsefefsves');
COMMIT;
INSERT INTO prices (price, guid, currency, url, datetime, store)
VALUES (100.00, 4, 'USD', SELECT id FROM urls WHERE url = 'sefsefefsves', '2015-03-22T06:34:45.926013+00:00', SELECT id FROM stores WHERE name = 'Win Condition Cards');
END;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment