Is there any way to do something like below query,
(select count(s.PUBLISHED_YN) as pub
from TRAINING_PERSONNELS s
where s.TRAINING_ID = t.TRAINING_ID
and s.PUBLISHED_YN =1 and s.assignment_num is null)
from TRAINING_PERSONNELS t
where t.TRAINING_ID = 29055 and t.assignment_num is null
From the same table i want to get total number of records,how many trainings are published and how many are completed ? I want to get it from the single query.
Please help me
SUM( case when <condition for determination whether "trainings is published/completed"> then 1 end )
Of course it would be easier to suggest something more precise, if you posted complete test case - CREATE TABLE statement for table definition, INSERT statements (up to 10) for representative sample data, required result set and description in English what are rules for achieving it.