How to eliminate selecting repeats in a statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cyprus106
    New Member
    • Apr 2008
    • 31

    How to eliminate selecting repeats in a statement

    I need a sql statement that doesn't select any record that has already been selected with the same data in a field.

    In other words, if I had these 3 records in the form of NAME, ID, and PHONE

    MATT, 333, 000-000-0000
    MATT, 333, 000-000-0000
    STEVE, 555, 000-000-0000
    RICK, 444, 000-000-0000

    I want to eliminate selecting MATT more than once. So the total record count would be 3 and there would only be one MATT. I've had a ton of trouble getting sql srv to play ball on this. I was hoping somebody could help me out.
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Use DISTINCT


    -- CK

    Comment

    Working...