SQL aggregate function subquery
问题 What I want to do is count the number of rows returned by a subquery, essentially the following: select pp.prop_id, COUNT((select employee_id from employee e where e.ao1_hours > 0)) from proposal_piece pp group by pp.prop_id order by pp.prop_id Here is my error message: Cannot perform an aggregate function on an expression containing an aggregate or a subquery. Why does this not work? If select is just returning a bunch of employee_id's with a filtering criteria why can't I count the number