Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

How to combine data from two rows into one row

$
0
0

I have the following sets of data. I want to find all the duplicate sets of field values. in the data below there is only one duplicate set: brenda, analyst, green.

DocID and Doc Seq combine to form the set key. FieldID I believe are consistent in that 1 is always name, 2 is job, 3 is favorite color etc. but there are up to 20 field IDs.

To tell you the truth, my client is a bit sketchy about the data and the values. I would like collapse the sets by getting all the field values into a single row. They could be in the same column, or in their own columns. This way I can then look for whatever dups my customer seems to think that he has.

the first image is what i want (either in same column or in different columns. but they have to be in the order of the FieldID), the second is what i have. THANKS



Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>