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
 Transact-SQL (2000)
 Searching Similar Unknown Values

Author  Topic 

andreoli
Starting Member

1 Post

Posted - 2002-08-02 : 23:05:42
I have a table with 2 fields with 90000 records.

Part_no : Character - Unique
Manuf_pn: Character - non unique BUT 99.5 percent are unique values anyway.

There are a few hundred Manuf_pn's that are similar in value.
How do I create a select statement that would return only those values that are similar in value?

Thanks,
Antonio


r937
Posting Yak Master

112 Posts

Posted - 2002-08-02 : 23:33:54
if "similar" means equal, this will return only those values that are in the table more than once, along with a count of how many times

select Manuf_pn, count(*)
from yourtable
group by Manuf_pn
having count(*) > 1



rudy
http://rudy.ca/
Go to Top of Page
   

- Advertisement -