select * from tbl where charindex('23', tel)>0 or charindex('2,3', tel)>0
如果是包含23例如123也算,则如下: select * from tb where tel like '23'如果是需要完全匹配23,例如123不算.则如下: select * from tb where ','+tel+',' like ',23,' select * from tb where charindex(',23,' , ','+tel+',') > 0
这个是完全匹配 也就是要找123 那么1234就是不对的 下面的是模糊匹配,你看着搞吧 select * from tb where tel like '%23%'
select * from tbl where charindex('23', tel)>0 or charindex('2,3', tel)>0
select * from tb where tel like '23'如果是需要完全匹配23,例如123不算.则如下:
select * from tb where ','+tel+',' like ',23,'
select * from tb where charindex(',23,' , ','+tel+',') > 0
下面的是模糊匹配,你看着搞吧
select * from tb where tel like '%23%'