select a.lastname,
(case count(1)is null then 0
else count(1)
end )
from hrmresource a, workflow_currentoperator b where a.id=b.userid group by a.lastname order by count(1) desc
想实现上面的效果,但是运行报错,求大神解答
就是count(1)没有结果就把count(1)列值置为0
有结果,值就为结果值
或者用nvl
select a.lastname,改成这个