General information
Forum:
Microsoft SQL Server
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only