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

Get unique instances from different tables

$
0
0

I have two tables in SQL. 

1) Claims with CLAIM ID 2) Work orders with WORK ORDER ID...connected to claims 

Work orders have a pricing type and a work order date. 

I have to create a list with claim ID's, associated work orders, and their pricing types, ordered by work order date. THEN, I want to return the unique combinations of pricing types (by date order)

For example

Claim 1: Pricing type (A,A,A)

Claim 2: Pricing type (A,B)

Claim 3: Pricing type (B,A)

Claim 4: Pricing type (A,B)

Would return

A,A,A:1

A,B: 2

B,A: 1

How can I do this with SQL? 


Viewing all articles
Browse latest Browse all 4729

Trending Articles



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