易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL Server 改为ORACLE的语法 - Oracle / 开发

select ID as '部门编号', Department as '部门名称', 
  [正式] = Sum ( case when EmployeeType = ' 正式 ' then Cnt else 0 end ),
  [临时] = Sum ( case when EmployeeType = ' 临时 ' then Cnt else 0 end ), 
  [辞退] = Sum ( case when EmployeeType = ' 辞退 ' then Cnt else 0 end ),
  [合计] = Sum ( case when EmployeeType <> '' then Cnt else 0 end ) 
from VDepartmentEmployeeType group by ID, Department

上面的sql是sqlserver的,是个表的行列转换
[正式] = Sum (...),改成oracle应该怎么写呢?
select ID as '部门编号', Department as '部门名称', 
  Sum ( case when EmployeeType = ' 正式 ' then Cnt else 0 end ) 正式,
  Sum ( case when EmployeeType = ' 临时 ' then Cnt else 0 end ) 临时 , 
  Sum ( case when EmployeeType = ' 辞退 ' then Cnt else 0 end ) 辞退,
  Sum ( case when EmployeeType <> '' then Cnt else 0 end ) 合计 
from VDepartmentEmployeeType group by ID, Department

这个
SQL code:
select ID 部门编号, Department 部门名称,
Sum ( case when EmployeeType = ' 正式 ' then Cnt else 0 end ) 正式,
Sum ( case when EmployeeType = ' 临时 ' then Cnt else 0 end ) 临时 ,
Sum ( case when EmployeeType = ' 辞退 ' then Cnt else 0 end ) 辞退,
Sum ( case when EmployeeType <> '' then Cnt else 0 end


相关问答:

csv文件转换成sql导入到数据库,没有数据为何?

执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......

Windows 7 怎样安装Oracle - Oracle / 基础和管理

各位大哥,帮个忙。

下个Oracle for vista 版本的安装试试
10G和11G的 
http://www.oracle.com/technology/software/products/database/index.html 
------------------------------------------- ......

oracle与aix - Oracle / 高级技术

在系统运行的时候总是有一块磁盘始终闪红灯,进入系统后
#topas查看总是有一块磁盘%BUSY为90%以上,
数据库版本:oracle 9.2.0.7 
数据文件挂载的节点:/oradata/pcs/ 逻辑卷号lv04 
#lslv -l lv04 ......

Oracle临时表使用问题 - Oracle / 开发

我的处理是这样的:
我有一个很大的数据集合,处于性能方面的考虑需要使用临时表过渡,并且使用分页的方式向临时表中插入数据,数据使用完毕后,删除临时表的数据。
出现的现象:当Oracle重新启动后,第一页插入的 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号