SQL语句:先按性别,性别相同再按年龄升序排序并输出学生的姓名,性别和年龄信息

2024-11-15 09:49:47
推荐回答(3个)
回答1:

select 姓名,性别,year(date())-year(出生日期) from 表名 order by 性别 asc,year(date())-year(出生日期) asc

还是我来答吧

回答2:

select 姓名,性别,年龄 from 表名 order by 性别,年龄

回答3:

select name,sex,age from tb_info order by sex,age esc