I have a table that a primary key that can have one to two different status' associated with it. It looks like this:
Key Status
123 Book
123 Change
122 Book
121 Book
121 Change
If there is a record that has status of 'Change' then I only want to select that record and not the record with the same key that has a status of 'Book'. If the key only has a status of 'Book' then I always want to choose that record. It is not possible to have a status of 'Change' without having a status of 'Book' first.
This is what I would like to see returned:
Key Status
123 Change
122 Book
121 Change
Any help?
Statusvalues (or clarify it is dynamic). – Akina Aug 17 '18 at 04:22