7. Find a salary increase of more than 15 employees

1, Title Description

Find salary rose more than 15 times the number of employees and its corresponding number emp_no rose t
the CREATE TABLE `salaries` (
` emp_no` int (11) the NOT NULL,
`salary` int (11) the NOT NULL,
` from_date` the NOT NULL DATE,
DATE to_date` the NOT NULL `,
a PRIMARY KEY (emp_no``, `from_date`));

Enter a description:

no

Output Description:

emp_no t
10001 17
10004 16
10009 18

2、

select emp_no,count(1) as t
from salaries
group by emp_no having count(1)>15;

 

The difference between (1) Find count (*) and count: Note

Guess you like

Origin www.cnblogs.com/guoyu1/p/12239696.html