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?