fullcone:select XH 学号, count(XM) 姓名, NL 年龄 from student 为什么提示错误,正确的应该怎么写

来源:百度文库 编辑:高校问答 时间:2024/07/04 03:23:15

如果楼主的目的是统计同名学生的个数可以这样写
oracle:

select xh as 学号,xm as 姓名,(select count(*) from student where xm=t.xm),nl as 年龄 from student t

不要用count

select XH 学号,XM 姓名,NL 年龄 from student