图: 主键-地区-销售人员-销售金额
问题是: 查询出所有超过本地区销售金额平均值 的销售金额
SELECT 表名.* from 表名,
(select avg(total) t,region from 表名 group by region) ta
where 表名.region=ta.region and 表名.total>ta.t
select total from 表名 group by region having total>agv(total)
select total from 表名 group by region having total>avg(total)