|
-
Nov 16th, 2009, 12:43 PM
#1
Thread Starter
Hyperactive Member
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.
-
Nov 16th, 2009, 02:24 PM
#2
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
-
Nov 16th, 2009, 02:35 PM
#3
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|