Skip to content

Instantly share code, notes, and snippets.

@thequbit
Created February 18, 2015 18:38
Show Gist options
  • Save thequbit/0aa98c89324ebc928649 to your computer and use it in GitHub Desktop.
Save thequbit/0aa98c89324ebc928649 to your computer and use it in GitHub Desktop.
result = session.execute(
'INSERT INTO clients(cuid) '
'SELECT * FROM ( SELECT ":cuid" ) AS temp_table '
'WHERE NOT EXISTS ( '
' SELECT cuid FROM clients WHERE cuid = ":cuid" '
') LIMIT 1;',
cuid=cuid
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment