我有这样一张桌子:
+----+------+--------+
| id | name | salary |
+----+------+--------+
| 1 | Ajay | 20000 |
| 2 | Aja | 2000 |
| 3 | Aj | 200 |
| 4 | A | 3000 |
| 5 | q | 30000 |
+----+------+--------+
我想写一个可以打印最高薪水,中等薪水和最低工资的查询。所以我写了这个查询:
select salary
from parent
where max(sal)
&& salary < ( SELECT MAX( salary )
FROM parent )
&& min(salary);
mysql返回错误:
ERROR 1111 (HY000): Invalid use of group function
什么是正确的查询?
答案 0 :(得分:0)
ArrayList<String> names = new ArrayList<>();