Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    May 2002
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    mostly distinct rows? (xp)

    I am trying to return only distinct rows from a table, but the table has an autonumber primary key, so there are no completely duplicate rows. I need to remove the duplicate data, though, ignoring the primary key. I cannot figure out any sort of DISTINCT or DISTINCTROW combination like select DISTINCT (everything but PKey) from TBL to get this done. I know I can just do a make table query that chops off the key field and then return distinct rows from that, but for various reasons I do not want to do that. I need to do it directly on the complete table if at all possible.
    Any suggestions?
    Thanks, Daren

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: mostly distinct rows? (xp)

    You might create a Totals query that uses Group By on all fields except the Autonumber PK field, and First (or Last or Min or Max) for the latter.

  3. #3
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: mostly distinct rows? (xp)

    ... Creating the Select Distinct ... on all data except the PKey should work. You might want to check your data for trailing spaces or other data making the records not unique.
    Regards,

    Gary
    (It's been a while!)

Posting Permissions

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