I have an Oracle database Table where
I have many columns in this particular table, but i want to get result on basis of computation between two columns as described below
Project|Status
-------|--------
1 | Done
1 | Pending
2 | Done
I want to get count of pending projects, for example if project 1 have a status pending and also it don't have done status anywhere in the table it will be a pending task, but if project 1 have a pending status and also have a done status in the table in any other row then this will not be a pending task,
I have tried this query but it is returning rows which have both pending and done status,
SELECT * FROM MYTABLE T
WHERE EXISTS
(SELECT 1 FROM MYTABLE WHERE Project = A.Project AND ROWID < A.ROWID AND
Status ='Done')
AND T.Status!='Done' AND T.Status='Pending'
@Update I also have other status values in this column like 'Partially Done' and 'Requested' and so i want to get only those projects which have only pending status and no 'Done' Status in whole table.