I need a SQL Server and Oracle compatible query to get the following result
Table:
PRIMARY IDN SECONDARY_IDN STATUS
1 47 Pending
2 47 Completed
3 47 Error
4 57 Pending
5 59 Completed
6 60 Pending
7 60 Completed
My input would be either Pending, Completed, or Error.
I need to list out all the secondary IDN with just 1 status and that is the input status.
For example my input is Pending: it should show up 57 ONLY. Others might have Pending but it also has completed and error records .
Can you please help me ?
1 Answer