Skip to content
Advertisement

SQL: finding duplicates that do not have a success message

I am struggling to return all batch_id’s that do not contain a corresponding “PASS”

From the above table, i need an sql statement that only returns batch_id 104 because it never had a status of “PASS”

The database is an oracle DB, therefore if its is not possible with a simple select statement a PL/SQL could be used. Does anyone have any suggestions?

Advertisement

Answer

You can select all batches that are pending, and among those filter out the one’s that have once passed. One solution could be:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement