求一SQL语句!!谢谢了~~
我的数据库中某字段,我们假设为:ttype,它共有N条记录,如下:
ID TTYPE
1 1,7
2 1
3 3
4 1,3
5 3,7
我现在想把ttype中有“1”的记录都select出来,请问这样的SQL怎么写?
[解决办法]
select * from tbname where charindex( ',1, ', ', '+TTYPE+ ', ')> 0