Hello,
I have this query:
SELECT
count( case when EXISTS (
SELECT *
FROM business_log bl, subject su
WHERE su.ID_SUBJECT = s.ID_SUBJECT
and bl.id_subject = su.id_subject
AND bl.value = 'Solved'
)
then 1 else null end) num_solved
FROM subject s
It is posible that one subject is more than once 'Solved' in table BUSINESS_LOG
I want to count only one row solved for one subject.
I must to use only SUBJECT table in the main query because of other counts.
Thank You very much.
Regards
Milos
Message was edited by: 2796614