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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-06-17 : 07:56:06
|
| srini writes "i have one zipfield which is having data like below oneid zip1 011,022,2022 055,078,9853 022,555,454i need to find out the id who is having 022 as zip in that table i dont know how to seperate one field data with , within that table Regardssrini" |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2005-06-17 : 07:59:35
|
SELECT * FROM myTable WHERE zip LIKE '%022%'Do yourself a huge favor, modify your data so that you store zips like this:id zip1 0111 0221 2022 0552 0782 9853 0223 5553 454 Your query then becomes:SELECT * FROM myTable WHERE zip ='022'It will perform far better, especially for larger tables. Storing the zips as you have them now will prevent SQL Server from effectively indexing them and will sacrifice performance. |
 |
|
|
|
|
|