Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Eliminate Duplicates
Message
From
11/07/2001 11:37:20
 
 
To
11/07/2001 00:43:39
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00528501
Message ID:
00529192
Views:
14
This message has been marked as a message which has helped to the initial question of the thread.
>Sorry for the confusion...row is not a column in the table there are only two cols...by row i just meant that there are 6 rows...

If this is a one-time query you can use the results of a distinct query (as suggested by the other reply) to create a new table to replace the old one.

If it's a frequently run query then you can use the following query to identify duplicates:

Select code, city From myCities Group By code, city Having Count(*)>1

It gets tricky if you want to create a single query that will remove duplicates and still leave one intact, but you can use a stored procedure to process the results of the above query and remove duplicates as accordingly.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform