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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Querying and Manipulating String Data

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-02-23 : 09:10:51
Mansoor writes "Just look at the table given below: I want to use e.g. 'WHERE' clause in a query without 'like' word. Can anybody help as how to retrieve PID number for a particular RegionKey.
PID RegionKey
1 '123'
2 NULL
3 '123','456'
4 '456','567','909'

Thanks - Look forward for a reply "

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-02-23 : 09:18:33
Why did you store RegionKeys in CSV format?
Make sure the table is normalised and save each RegionKey in seperate rows
Refer this
http://www.datamodel.org/NormalizationRules.html

Why do you want to avoid like?

Select PID from yourTable where charindex(yourVal,RegionKey)>0


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -