January 1, 2003 at 2:17 pm
Hi,
I'm trying to import a table to a new database design and I have a unique constraint on the 'email' column. The old table i'm trying to import has duplicates in the email column.
How can I view all the duplicates for a particular column in a table?
Its something like Having (count(*)) > 1 or something?
January 1, 2003 at 3:19 pm
Exactly. You can set the ignore dupe option to just get all the unique rows - if that makes sense in your situtation.
Andy
January 1, 2003 at 6:18 pm
Andy, can you give me the query. I'm not sure what it is ...
January 1, 2003 at 6:35 pm
Sure. This works in Northwind.
select productid, count(*) as count from [order details] group by productid having count(*)>1
Andy
October 18, 2012 at 7:22 am
Hi
I'm very new to sql....
I would like to display duplicate emails but also their respective account numbers from a table but can only work out how to pull the duplicates.... Do I need to insert the below into another statement please? Hope you can help....
select emailaddress, count (*) from
vwdimcustomer
group by emailaddress
having count (*) > 1
Sorted 🙂
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply