oracle,count 函数

2025-05-13 14:26:24
推荐回答(1个)
回答1:

select p_id, count(s_id)
from table
where p_id = :p_id(这个就是父节点的ID)
group by p_id

或者查出所有父节点的:
select p_id, count(s_id)
from table
group by p_id