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.
| Author |
Topic |
|
ramdas
Posting Yak Master
181 Posts |
Posted - 2009-06-01 : 14:40:13
|
| Hi,I have a table which has a filed called GrpName. The values are likeGrpID GrpName1 A,B,C2 B,C3 BWhen the user passes the selection as 'B,C'to the stored procedure, I want the rows 1,2,3 to be returned as the result set. How would i achieve this. When I used the Like statement i got back only GrpID 2 back. Any thoughts on this...Thank youRamdas NarayananSQL Server DBA |
|
|
vishal.gadhia@gmail.com
Starting Member
4 Posts |
Posted - 2009-06-01 : 16:25:55
|
| Hi Ramdas:SELECT Grpid, GrpNameFROM GroupWHERE GrpName LIKE '%[B,C]%'This query shall give your ur desired results as well as it even if you change the character from 'B,C' to 'A,B', it shall still return the whole set of values.I hope this helps.ThanksVishal GadhiaAspiring DBA |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-02 : 13:04:59
|
| you should certainly read about normalisation |
 |
|
|
|
|
|