Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select Statement help
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

2 Posts

Posted - 12/21/2012 :  12:12:49  Show Profile  Reply with Quote
This may sound basic, but I am new to these statement.

My simple statement has duplicate rows. Lets say 100 rows per contact with the same information. How do I make the statement just pull on row per contact? Not sure if I should use DISTINCT OR JOINS?

Flowing Fount of Yak Knowledge

5155 Posts

Posted - 12/21/2012 :  12:41:52  Show Profile  Reply with Quote
You can use DISTINCT as in
The thing to keep in mind though, is that distinctness is determined by all the columns in the select list. If even one column has different values, then the two rows are considered distinct and so you will get two rows in the output.

There are other ways to do distinct - see Madhivanan's blog
Go to Top of Page

Starting Member

2 Posts

Posted - 12/21/2012 :  12:45:36  Show Profile  Reply with Quote
Thank you I will give it a try. I think I became a bit impatient and didn't wait log enough. I have thousands of records to go through.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000