Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Unique Instances in a table

$
0
0

I used a join to get claims and then work order information. I ordered by date. There is a column called "Type" that I would like isolate. I want to return the unique instances (same order as date) horizontally. 

Based on my data below, I want. 

A, A (this is for claim 1 and 2 but I just want unique patterns)

B (this is the order for claim 3 and 4)

A,B,D,C

If possible I would like the number of instances as well. 

So, (A,A) 2

(B) 1

(A,B,D,C) 1


Viewing all articles
Browse latest Browse all 7129

Trending Articles



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