Skip to content

Instantly share code, notes, and snippets.

@markgajdosik
Created September 22, 2016 11:06
Show Gist options
  • Save markgajdosik/009ba6fabccf3cf4dc76f7f01958f441 to your computer and use it in GitHub Desktop.
Save markgajdosik/009ba6fabccf3cf4dc76f7f01958f441 to your computer and use it in GitHub Desktop.
cursor.execute(textwrap.dedent('''
DROP TABLE IF EXISTS repeating;
CREATE TEMPORARY TABLE repeating ON COMMIT DROP
AS SELECT
{bat}.row, {cucm}.used_for, {bat}.field_id, {bat}.index
FROM {bat} INNER JOIN {cucm} ON
{cucm}.system_type = %s AND
{bat}.field_id = {cucm}.id
WHERE {bat}.row IN %s AND {cucm}.used_for IN %s {index}
'''))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment