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 |
girishkardam
Starting Member
13 Posts |
Posted - 2008-10-15 : 02:41:47
|
Hi Frnds,I am having two columns Phone1 & Phone2. Phone1 field is having multiple phone number seperated by , and Phone2 field is having single phone number. I want to compare both the fields and fetch only those rows which are having same phone number. |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-10-15 : 03:15:36
|
Where phone1=phone2Post some sample data with expected resultMadhivananFailing to plan is Planning to fail |
 |
|
girishkardam
Starting Member
13 Posts |
Posted - 2008-10-15 : 03:24:36
|
hi thx for the reply.I am having data in following formatPhone1 Phone2731-2525251,5689566 5689566731-5678252,2365623 2621455In the above example i am having common phone number in first record i.e 5689566 in both the fields while in second record there is not any same phone number in both fields.In this way i am hvg 30000 records and i want to fetch only those rows where same phone number is available in both the fields like in record one. I think this will my query. |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-10-15 : 03:28:09
|
Where ','+phone1+',' like '%,'+phone2+',%'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|