SQL语句总出现 缺少右括号 检查过很多遍还是不对 帮忙看一下

2024-12-29 02:53:09
推荐回答(2个)
回答1:

sql中没有STRT_TIME<='6'<=ENDX_TIME这种连等式,需要拆开用and连接
((stime>=6 and etime<=6) or(stime>=8 and etime<=8))

回答2:

and ( STRT_TIME<='6'<=ENDX_TIME or STRT_TIME<='8'<=ENDX_TIME )

可以这样用么?
改成
and ((STRT_TIME<='6' and '6'<=ENDX_TIME) or (STRT_TIME<='8' and '8'<=ENDX_TIME))