diff --git a/sqlExport.py b/sqlExport.py index abb64ee..73efd69 100755 --- a/sqlExport.py +++ b/sqlExport.py @@ -32,7 +32,7 @@ def insertDistinctFromTableMap(table, data, tableMap): # TODO: this could probably be done better as a single statement? c.executemany( f"""INSERT INTO {table} ({','.join(f'`{k}`' for k in tableMap.keys())}) - SELECT {','.join(len(tableMap) * ['%s'])} + SELECT {','.join(len(tableMap) * ['%s'])} FROM DUAL WHERE NOT EXISTS ( SELECT 1 from {table} WHERE {' AND '.join(f'`{k}`<=>%s' for k in tableMap.keys())}