
sql语句
dare_
这个作者很懒,什么都没留下…
展开
-
select count 多条统计
select EmpDepID, count(1) as 总人数, count(case when EmpSex = 300 then 1 end ) as 男生数, count(case when EmpSex = 301 then 1 end ) as 女生数 from dbo.tbEmployee group by EmpDepID原创 2013-12-31 15:52:07 · 1103 阅读 · 0 评论 -
【sql】decode函数 翻译值
decode()函数简介: 主要作用:将查询结果翻译成其他值(即以其他形式表现出来,以下举例说明); 使用方法: Select decode(columnname,值1,翻译值1,值2,翻译值2,...值n,翻译值n,缺省值) From talbename Where … 其中columnname为要选择的table中所定义的column, ·含义解释:转载 2014-11-06 15:04:50 · 1042 阅读 · 0 评论