General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>I want to create a primary index on my table based upon a combination of two fields. It has 2960 records. I ran a query on it with no duplicates checked it appears to have 12 dups of this combination. Whats the best way to find the dups so I can clean them up. There is no reason for the dups. Thanks.
>
>God Bless,
>S Dyke
Steven,
Try this:
Select column1, column2, cnt(column1) as cnt_cols;
from my_table;
group by column1, column2;
order by cnt_cols desc
Where column1 and column2 are the columns you want your primary index on. When you get this query the dup records will be at the top of the query.
HTH
Jeff
Previous
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