出头的椽子先烂的意思:select XH 学号, count(XM) 姓名, NL 年龄 from student 为什么提示错误,正确的应该怎么写

来源:百度文库 编辑:杭州交通信息网 时间:2024/06/07 23:20:02

如果楼主的目的是统计同名学生的个数可以这样写
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