Consulting

Results 1 to 2 of 2

Thread: Unique records

  1. #1
    VBAX Regular
    Joined
    Jul 2004
    Posts
    13
    Location

    Unique records

    Hi

    I am having a data consists of 10 columns in a table. Among 10 columns, one column is having duplicates and all other coulmns are different, for eg., in the below example, There are duplicates in Key but not in Name... I want to retrieve only unique records( non duplicates and one from each duplicate).

    Key Name ................

    24 jack
    42 robet
    42 rhode
    42 richter
    42 rammy
    67 tony
    67 tam
    89 walter
    95 wong
    95 warne

    OUTPUT:

    Key Name
    24 jack
    42 robet
    67 tony
    89 walter
    95 wong

    Thanks in Advance,
    John

  2. #2
    VBAX Regular
    Joined
    Aug 2004
    Location
    Mesquite, Texas
    Posts
    13
    Location
    I don't have an exact answer yet; but I have solved this kind of problem using two or three "nested" queries using aggregate functions. Like one would select the min of Key and Name, then the second would use that result and the original table - matching on the name and maybe the key field to fill in the rest of the data needed.
    Hope that helps.

Posting Permissions

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