我正在尝试进行类似于以下的查询:
ctx = snowflake.connector.connect(
host=host,
user=user,
password=password,
account=account,
warehouse=warehouse,
database=database,
schema=schema,
protocol='https',
port=port)
## Create a cursor object.
cur = ctx.cursor()
## Execute a statement that will generate a result set.
sql = "select * from t"
cur.execute(sql)
我的查询看起来像这样:
select NUMBER, ID, DATE, CODE from DATABASE.SCHEMA.TABLE
where (cast(CODE as string) like 'ABC12%'
and (DATE < '2021-12-31' and DATE >= '2021-10-01')
我收到此错误:
ProgrammingError: 001003 (42000): SQL compilation error:
syntax error line 3 at position 52 unexpected '<EOF>'.
我查看了此错误代码并尝试删除可能存在的任何特殊字符,但没有运气。
提前致谢