Finding possible matches

Please support our MS SQL advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2008
Posts: 1
Reputation: MaMaMiYa is an unknown quantity at this point 
Solved Threads: 0
MaMaMiYa MaMaMiYa is offline Offline
Newbie Poster

Finding possible matches

 
0
  #1
Sep 4th, 2008
Hi, lets say I have the following 7 records in my database

ID Model
-- ------
1 400
2 400FL
3 400 FL
4 ABC
5 SGH500
6 SGH-500
7 SGH 500

How is it possible if i could select out the rows which are of possible match to some other rows?

E.g. IDs 1, 2 & 3 are possible matches of one another and IDs 5, 6 & 7 are possible matches of one another. ID 4 will not be displayed in the result.

Thanks a lot in advanced
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 470
Reputation: khess is on a distinguished road 
Solved Threads: 8
Staff Writer
khess's Avatar
khess khess is offline Offline
Staff Writer

Re: Finding possible matches

 
0
  #2
Sep 5th, 2008
Use the LIKE keyword in your SELECT statement.
  1. SELECT Model FROM Table WHERE Model LIKE '%00';

Experiment with that. You may also be able to use regular expressions in the LIKE constraint.
Last edited by peter_budo; Sep 7th, 2008 at 8:47 am. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 149
Reputation: Geek-Master is an unknown quantity at this point 
Solved Threads: 6
Geek-Master's Avatar
Geek-Master Geek-Master is offline Offline
Junior Poster

Re: Finding possible matches

 
0
  #3
Feb 2nd, 2009
Using the like constrait with '%00' would work for this sample, but would still require the human eye to make the associations with each possible duplicate. I'm not exactly sure what the solution would be for something with 60,000 records, but I have a feeling it will take more than one query for this kind of scenario. I too have some duplicate records to deal with (hence 60,000 records) and was hoping to stumble on a solution as well. I'm thinking about trying to do something with a pivot table or a custom tool. If I find something I will be sure to post back my results.
If in doubt, reach into the trash can and remove the user guide.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC