SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to find single value from comma separated valu
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

priyankas
Starting Member

2 Posts

Posted - 09/01/2012 :  04:07:51  Show Profile  Reply with Quote
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

India
52249 Posts

Posted - 09/01/2012 :  04:17:27  Show Profile  Reply with Quote

select *
from table
where ',' + field + ',' LIKE '%,' + @value + ',%'


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

Go to Top of Page

priyankas
Starting Member

2 Posts

Posted - 09/01/2012 :  04:35:41  Show Profile  Reply with Quote
Thanks for this

Pri
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 09/01/2012 :  12:37:43  Show Profile  Reply with Quote
welcome

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

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000