Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2008
    Posts
    55

    Unanswered: Using Distinct on Multiple Fields

    Hello all,

    How can I use Distinct on multiple fields?
    Sample Data:

    ID Date
    123 10-10-2008
    456 12-09-2008
    123 10-10-2008


    I want the result table to show only row 1 and 2.
    I tried Select Distinct ID, distinct Date.
    This didn't work. Any suggestions?

    Thank you!!

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Code:
    SELECT DISTINCT id, date
    FROM the_table
    Naming a column date is not a good idea. Date is a reserved word.

  3. #3
    Join Date
    Dec 2008
    Posts
    19
    SELECT DISTINCT field1, field2, field3 FROM tablename

  4. #4
    Join Date
    Aug 2008
    Posts
    55
    Thank you !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •