参考http://blog.sina.com.cn/s/blog_9e0bd57301016mru.html
多个子句时,
with branch_total(branch_name,val)as
(select branch_name,sum(balance)
fro m account
group by branch_name), //逗号不可少
branch_total_avg(val)as
(select avg(val)
fro m branch_total)
select branch_name
fro m branch_total,branch_total_avg
where branch_total.val>=branch_total_avg.val
并且上一条语句必须以‘;’结尾
网友评论