Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting the NON unique rows 1

Status
Not open for further replies.

JavaSprout

Programmer
Jul 31, 2001
30
0
0
BE
I have a location table with fields:

loc_key
country_key
unique_loc_name

I eventually want to create a unique index on country_key + unique_loc_name, but at the moment the unique_loc_name is not unique for a given country_key! So, I need to dig out all those rows which are not unique.

So, how do I extract all the rows where there are duplicate rows matching country_key and unique_loc_name?

Thanks!


Hugh Prior
webmaster
Regional Search Engine
 
select unique_loc_name,country_key,count(unique_loc_name) from YOUR_TABLE group by unique_loc_name having count(unique_loc_name) > 1 ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top