作业帮 > 综合 > 作业

VF中统计各年份出生人数的select语句怎么写啊?

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/14 15:29:02
VF中统计各年份出生人数的select语句怎么写啊?
编写select语句,从customers中统计出各年份出生的客户人数,结果依次包含“年份”“人数”两个字段.
select year(生日) as 年份,count(*) as 人数 from customers group by year(生日)
再问: SELECT YEAR(Customers.出生日期)as 年份,count(*)as 人数; from customers group by 年份 order by 人数 ,into table tableone 他说有无法识别的语句,帮我查一下哪里错了,谢谢了
再答: group by YEAR(Customers.出生日期),order by那个地方在VF里能不能用我也不确定,一般情况下在数据库里计算字段是无法直接order by 的,除非加一个嵌套 不要直接group by别名 还有as 年份和前边留点空格,不要连起来