select id,name,gender,home, upper(email) as email, age, party,concat(name,':(',cast(age as char),')','岁
') as result from student where length(email) > 15
2、答:
select count(id) as total_num, max(age) as max_age, min(age) as min_age,avg(age) as avg_age from student
3、答:
select avg(age) as avg_age from student where age != (
select age from student order by age limit 1
) and age != (
select age from student order by age desc limit 1
)
4、答:
SELECT count(*) FROM `student` where party = 1 and home like '辽宁省%' group by gender
5、答:
select result from(
SELECT count(*) as result FROM student group by home like '辽宁省%',gender
) as foo order by result desc limit 1
6、答:
SELECT count(*) FROM (
select * from student order by age desc limit 1,5
) as tmp group by gender