select
(select sum(to_number(工资)) from table1 where 班组 in('一班')) -
(select sum(to_number(工资)) from table1 where 班组 in('二班')) from dual
(select sum(to_number(工资)) from table1 where 班组 in('一班')) -
(select sum(to_number(工资)) from table1 where 班组 in('二班')) from dual
解决方案 »
- VFP调用ORACLE存储过程返回结果集
- ORACLE客户端 ORA-12541 TNS 没有监听 问题 !请帮忙
- (50分)oracle 建立数据库
- 登陆 oem 问题,进来看看!
- 我如何在Oracle系统表中取得我自己的某一表所有的非空字段?还有PK字段呢,请教
- 求一个sql表达式?
- 查询当前user下表的记录数
- 存储过程???????
- 估计还是oracle字符集的问题,请各位帮忙给看看!!!
- 导入数据出现IMP-00010 not a valid export file, header failed verification 错误提示!
- 急问:raise exception的语法(希望能有举例)
- 关于sql语句的问题,请各位指点
or:
select a.一班工资 - b.二班工资 from
(select sum(to_number(工资)) 一班工资 from table1 where 班组 in('一班')) a ,
(select sum(to_number(工资)) 二班工资 from table1 where 班组 in('二班')) b
select round(321.456,2) from dual
32.46
取整,四舍五入
select round(321.556) from dual
33
取整,截掉 小数部分
select trunc(321.556,2) from dual
32
from yourTable
trunc(a,2):按位截取
round(a,2):按位四舍五入
from yourTable