I have this information.
Table OrderTotals
Order Value
A 10
B 20
C 15
Table Orderdetails
Order Line Description
A 11 Red
B 24 Blue
B 25 Green
B 28 Yellow
C 17 Green
And I want this output
Order Line Description Value
A 11 Red 10
B 24 Blue 20
B 25 Green
B 28 Yellow
C 17 Green 15
Is this possible? And if yes, how?
ROW_NUMBER()sorted on yourLineand use aCASE WHENif it's 1 to only then select the order total with a subquery you'd get there.