如图
比如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 '不存在'
------解决方案--------------------