您的位置:首页 > 其它

group by where条件的设置

2012-06-07 15:57 239 查看
/*

where要放在group by前面

group by 后面加条件只能用having关键字

*/

select case_id, count(*) from td

inner join TD_PROC proc

on td.wf_proc_id = proc.businessid

and proc.type != 'done'

where case_id is not null --where要放在group by前面

group by case_id

--可用having case_id is not null
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: