I'm trying to run the following code in Python to check various columns in SQL for entries containing the @ symbol:
out = pd.read_sql_query('select count(*) from [A].[' + str(Table1) + '] where [' + str(Column1) + '] not like '%@%'', cnxn)
The script has a loop which changes the Table1 and Column1 each time it runs. But the "not like '%@%''" part is causing issues. How do I correct this?
When I run it, I get the error
SyntaxError: invalid syntax