Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to find single value from comma separated valu

Author  Topic 

priyankas
Starting Member

2 Posts

Posted - 2012-09-01 : 04:07:51
Hi all,

Please help me for this,

my records is like that

Groups
2,3,4
1,2,3,5,7
3,7,8
1,4

and if i am searching for 4 from the group column then below output should be display

Groups
2,3,4
1,4

Thanks in advance

Pri

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-09-01 : 04:17:27
[code]
select *
from table
where ',' + field + ',' LIKE '%,' + @value + ',%'
[/code]

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

priyankas
Starting Member

2 Posts

Posted - 2012-09-01 : 04:35:41
Thanks for this

Pri
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-09-01 : 12:37:43
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -