select
filedA,
conv(filedA, 10, 2),
case when conv(filedA, 10, 2) like '%1010000'
or filedA< 31 THEN "NO" ELSE "YES" END AS THEVALUE
from
table 1
上面我的sql查询总是返回Yes值;这是错误的。例如,如果字段A 80的值,二进制值1010000和返回值应为No,但返回的是。
答案 0 :(得分:0)
使用and
代替or
select
filedA,
conv(filedA, 10, 2),
case when conv(filedA, 10, 2) like '%1010000'
and filedA< 31 THEN "NO" ELSE "YES" END AS THEVALUE
from
table