create table `account`(`id` int(11) not null auto_increment,`year` int(11) not null comment '年份',`name` char(30) not null comment '销售员',`month` int(11) not null comment '月份',`sales` int(11) not null comment '销售额',primary key(`id`))engine = innodb;
select name, sum(sales) from account where month = 12 and year = 2018 group by name having count(sales)=12 order by name asc
select name, sum(sales) from account where month = 12 group by name having year=2018 order by name asc
select name, sum(sales) from account where year = 2018 group by name having count(sales)=12 order by name asc
select name, sum(sales) from account group by name having year=2018 and count(sales)=12 order by name asc