[code=SQL]
SELECT DISTINCT * FROM
(
select * from t_info where gid='1'
union all
select * from t_info where charindex('1,',gid)>0
union all
select * from t_info where charindex(',1,',gid)>0
)A
select * from t_info where gid='1'
union all
select * from t_info where charindex('1,',gid)>0
union all
select * from t_info where charindex(',1,',gid)>0
[code=SQL]
select * from t_info where charindex('1',gid)>0
union all
select * from t_info where charindex('1,',gid)>0
union all
select * from t_info where charindex(',1,',gid)>0