Results 1 to 4 of 4
  1. #1

    PHP/MySQL and Distinct

    Hey guys,

    I've got a mysql table that may have duplicate field entries for the field "name". I'd like to list all these entries, but not list any duplicates.

    Now I can do that with distinct, if I use:

    PHP Code:
    But then I can't access any of the other information in the table. Can someone tell me how to use distinct in conjunction with using * to select all the fields for listing?

    I hope that made sense.

    Jon Marus

  2. #2
    I've found that I can do DISTINCT(name), age, location

    But is there a way to do DISTINCT(name), * ?

  3. #3
    Join Date
    Nov 2002
    try something like:

    SELECT DISTINCT(, t.* FROM table t;

  4. #4
    Ah, so simple. Thank you t3r0.

Posting Permissions

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