Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 7,2000
»
T-SQL
»
display duplicate columns
display duplicate columns
Rate Topic
Display Mode
Topic Options
Author
Message
sql777
sql777
Posted Wednesday, January 01, 2003 2:17 PM
Grasshopper
Group: General Forum Members
Last Login: Saturday, January 24, 2004 7:27 PM
Points: 23,
Visits: 1
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?
Post #9053
Andy Warren
Andy Warren
Posted Wednesday, January 01, 2003 3:19 PM
SSCertifiable
Group: Moderators
Last Login: Tuesday, June 11, 2013 6:34 AM
Points: 6,463,
Visits: 1,388
Exactly. You can set the ignore dupe option to just get all the unique rows - if that makes sense in your situtation.
Andy
http://www.sqlservercentral.com/columnists/awarren/
Andy
SQLShare - Learn One New Thing Each Day
SQLAndy - My Professional Blog
Connect with me on LinkedIn
Follow me on Twitter
Post #50636
sql777
sql777
Posted Wednesday, January 01, 2003 6:18 PM
Grasshopper
Group: General Forum Members
Last Login: Saturday, January 24, 2004 7:27 PM
Points: 23,
Visits: 1
Andy, can you give me the query. I'm not sure what it is ...
Post #50637
Andy Warren
Andy Warren
Posted Wednesday, January 01, 2003 6:35 PM
SSCertifiable
Group: Moderators
Last Login: Tuesday, June 11, 2013 6:34 AM
Points: 6,463,
Visits: 1,388
Sure. This works in Northwind.
select productid, count(*) as count from [order details] group by productid having count(*)>1
Andy
http://www.sqlservercentral.com/columnists/awarren/
Andy
SQLShare - Learn One New Thing Each Day
SQLAndy - My Professional Blog
Connect with me on LinkedIn
Follow me on Twitter
Post #50638
petfrefionak
petfrefionak
Posted Thursday, October 18, 2012 7:22 AM
Forum Newbie
Group: General Forum Members
Last Login: Wednesday, May 29, 2013 2:54 AM
Points: 2,
Visits: 54
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
Post #1374341
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.