Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1466780
  • 博文数量: 295
  • 博客积分: 10051
  • 博客等级: 上将
  • 技术积分: 3850
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-11 08:50
文章分类

全部博文(295)

文章存档

2011年(1)

2009年(4)

2008年(290)

我的朋友

分类: Mysql/postgreSQL

2008-04-16 09:10:42

sql: select gwlb, count(case when (year(getdate())-year(rybirthday)) between 20 and 30 then rygh end) as '20-30', count(case when (year(getdate())-year(rybirthday)) between 30 and 40 then rygh end) as '30-40', count(case when (year(getdate())-year(rybirthday)) between 40 and 50 then rygh end) as '40-50', count(case when (year(getdate())-year(rybirthday)) between 50 and 60 then rygh end) as '50-60', count(case when (year(getdate())-year(rybirthday)) between 60 and 70 then rygh end) as '60-70' from t_ry group by gwlb
阅读(729) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~