php mysql统计数据
问题描述:
有张表格有Id,name,deptId,salary,country五个字短,我想通过php mysql统计出工资高于中国人平均工资的中国人数!!
答
select count(*) from 表名 where salary>(select avg(salary) from 表名)