I’m quite new in SQl This is my requirement.
TableA
operation route measurement
A No 200
A Yes 300
B No 400
B Yes 500
I want this as result
Operation MeasurementNo MeasurementYes MeasureDifference
A 200 300 100
B 400 500 100
So the operation field has to be grouped. At the same time the two values of the measurement of the operation have to be merged to one row.
The MeasureDifference = MeasurementYes - MeasurementNo.
It looks not that difficult too achieve with SQL, but I’m just a newbee. Any help is appreciated.
Or use grouping and conditional aggregation: