
sql查询操作基础语句
select * from hero where name like '%孙%';
select * from hero where age<=35 order by age asc;
select * from hero where age<=35 order by age asc,life desc;
select count(*) from hero;
select count(*) from hero where age<40;
select sum(max_score) from hero;
select avg(max_score) from hero;
select max(max_score) from hero;
select sum(life),sex from hero group by sex;
select count(*),sex from hero where age<30 group by sex;
select count(*),sex from hero where age<30 group by sex having count(*)>2;
select * from hero limit 2,6;
create table hero{
id int primary key auto_increment,
name varchar(20) unique not null,
age int default 10;
}
alter table hero drop primary key;

被折叠的 条评论
为什么被折叠?



