ITeye博客

sql 统计总数和各状态数

kingmxj · 2010-04-22 14:47 · Oracle · 数据库 · SQL · Markdown

select g.dept_id, count(g.dept_id) as '总数', sum(case g.is_deal when '0' then 1 else 0 end) as '办理', sum(case g.is_deal when '1' then 1 else 0 end) as '未办理' from getnumber g where g.style='0' or g.style is null group by g.dept_id

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。