如何实现这个的sql语句
aboys 2003-08-19 04:32:09 select distinct col1 FROM tableName where
col2 in (case when 1=1 then 'bbb','aaa' else '' end)
提示错误:
服务器: 消息 170,级别 15,状态 1,行 2
第 2 行: ',' 附近有语法错误。
改为:
select distinct col1 FROM tableName where
col2 in (case when 1=1 then '''bbb'',''aaa''' else '' end)
没有错误,但是找不到记录,(col2中有这样的记录)