I have a table which contains many records for a RequestID ,
Each request has a BookingID .
Aim : to write a stored procedure and create an output table
which contains a RequestID and Status ( If any request has a Status of ‘C’ then Status
overrides any other status other status is whatever is on input.
Input Table
Request ID Booking ID Status
001 50 NC
001 51 C
001 52 NC
001 53 C
002 54 NC
002 55 NC
002 56 NC
003 57 C
004 58 NC
004 59 NC
004 60 NC
Output Table should produce this :
Request ID Status
001 C
002 NC
003 C
004 NC
Please advise …
Thankyou
Each request has a BookingID .
Aim : to write a stored procedure and create an output table
which contains a RequestID and Status ( If any request has a Status of ‘C’ then Status
overrides any other status other status is whatever is on input.
Input Table
Request ID Booking ID Status
001 50 NC
001 51 C
001 52 NC
001 53 C
002 54 NC
002 55 NC
002 56 NC
003 57 C
004 58 NC
004 59 NC
004 60 NC
Output Table should produce this :
Request ID Status
001 C
002 NC
003 C
004 NC
Please advise …
Thankyou