Results 1 to 3 of 3

Thread: when the field is a duplicate

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2009
    Posts
    273

    when the field is a duplicate

    There are duplicates of a specific field in a sql database. If the selected row has a duplicate in the code field then I want to select one of them as 'a' as field2 and one of them as 'b' as field2.
    something like: case when the code field is a duplicate in the database, then select one of the duplicates as 'a' and the other as 'b' as field2 . there is no primary key in the table.
    What would be the best way to accomplish this?
    Thank you.

  2. #2
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Re: when the field is a duplicate

    How is your table structured? From reading your post, it appears you want the duplicate records to get sorted in two different buckets. What happens if there's a third record with the same column values?
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2009
    Posts
    273

    Re: when the field is a duplicate

    The first value should be 'a' and all the rest of duplicate values(second, third...) should be 'b'.
    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
  •  



Click Here to Expand Forum to Full Width