怎么判断一个列中存在某两个值
如图
比如D列 中是否存在a并且存在b
[解决办法]
- SQL code
if exists(select 1 from tb where d='a' or d='b')print '存在'elseprint '不存在'
[解决办法]
- SQL code
if exists(select 1 from tb where d in('a', 'b') having count(distinct d)=2)print '同时存在a/b'elseprint '不存在'
[解决办法]