Getting unique values

Discussion in 'PHP' started by pmf123, Oct 26, 2010.

  1. #1
    I have a database query:

    SELECT * from `ukbiz` WHERE name LIKE '%$NAME%'

    some entries are duplicated, and i want to eliminate the dupes by looking for matching phone numbers... i know i can do this:

    SELECT DISTINCT phone from `ukbiz` WHERE name LIKE '%$NAME%'

    but that only returns phone numbers, i want all values returned, just with unique phone numbers....

    help?
     
    pmf123, Oct 26, 2010 IP
  2. sincos

    sincos Active Member

    Messages:
    64
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    51
    #2
    SELECT * from `ukbiz` WHERE name LIKE '%$NAME%' group by `phone`
     
    sincos, Oct 26, 2010 IP