比如判断2是否在2,3,4,5 中效率最高的方法,
------解决方案--------------------
- SQL code
select (case when len(replace(','+'1,2,3,4,5'+',',','+ltrim(2)+',','')) < len(','+'1,2,3,4,5'+',') then 1 else 0 end)
select (case when len(replace(','+'1,2,3,4,5'+',',','+ltrim(2)+',','')) < len(','+'1,2,3,4,5'+',') then 1 else 0 end)