文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>sql交叉查询

sql交叉查询

时间:2007-02-17  来源:PHP爱好者

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


php爱好者站 http://www.phpfans.net 网页制作|网站建设|数据采集.
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载