create table company(
name character varying(32),--名称
pay integer--工资
);
insert into company(name,pay) values('小明',1110);
insert into company(name,pay) values('小2',1120);
insert into company(name,pay) values('小3',1130);
insert into company(name,pay) values('小4',1140);
insert into company(name,pay) values('小5',1150);
insert into company(name,pay) values('小6',1160);
delete from company where pay>(select avg(pay) from company);
--select * from company; |