Select * from
odk_prod._refinance_tags
where (end_date like '%2017-06%' or end_date='0000-00-00')
and app_no in ('APP-000-095','APP-000-115')
答案 0 :(得分:0)
您错过了单引号
Select a.* from
odk_prod._refinance_tags a
where (end_date like '%2017-06%'
or end_date='0000-00-00'
)
and app_no in ('APP-000-095','APP-000-115')
答案 1 :(得分:0)
我不知道您的问题是什么,但是您可以改善查询条件。
请勿使用like
作为日期!而是使用日期函数和日期比较:
Select rt.*
from odk_prod._refinance_tags rt
where ( (rt.end_date >= '2017-06-01' AND
rt.end_date < '2017-07-01'
) or
rt.end_date = '0000-00-00'
) and
rt.app_no in ('APP-000-095', 'APP-000-115');