select * from t1
where exists ( select 1 from t2
where t1.staffID=t2.staffID
and nvl(t1.sumcode,0) > nvl(t2.maxcost,0))
where exists ( select 1 from t2
where t1.staffID=t2.staffID
and nvl(t1.sumcode,0) > nvl(t2.maxcost,0))
解决方案 »
- 这段psql语句是什么意思?求高手!
- 机器上装有MSsql2005,我现在装Oracle9i可就是装不上,请求援助
- Oracle 如何获取上个月的第一天星期天和最后一个星期天的日期
- 取消oracle表空间存储限额
- 求助:Oracle触发器能不能捕捉到引起触发的事件,怎么捕捉?
- 求助,一条简单的存储过程实现
- sqlca.sqlcode=[-1013]表示什么?
- sqlldr数据导入问题,在线等
- 问大家Oracle9i和Oracle10g是什么关系?后面的字母i和g分别表示什么 ?是什么单词的缩写?知者进来领分!
- 关于jdbc远程连接oracle的问题,急,帮帮兄弟吧!!
- 请问,oracle 有象MSSQL 一样的DEMO 数据库吗?
- 插入时间格式的字段错误,望帮助我这第一次用oracle 的同志吧
where t1.staffid=t2.staffid and t1.sumcost>t2.sumcost;
where t1.staffid=t2.staffid and t1.sumcost>t2.sumcost;
where t1.staffid=t2.staffid and t1.sumcost>t2.sumcost;
这个吧
where t1.staffid=t2.staffid and t1.sumcost>t2.sumcost;
这个简单易懂
where exists ( select 1 from t2
where t1.staffID=t2.staffID
and nvl(t1.sumcode,0) > nvl(t2.maxcost,0))
我不懂啊!
这个select 1 from t2是什么意思啊?
谢谢大哥解释一下啊!
nvl(t1.sumcode,0) > nvl(t2.maxcost,0))
这样还是更保险吧
a.*
from
t1 a
left join
t2 b
on
a.staffID = b.staffID and nvl(a.sumCost,0) > nvl(b.maxCost,0)
where t1.staffid=t2.staffid and t1.sumcost>t2.sumcost;不能选出 005 a1550 这条记录,需要用左连结select t1.* from t1,t2
where t1.staffid+=t2.staffid and t1.sumcost+>t2.sumcost;
自己试一下吧
005 a1550 这条记录的staffid是a1,不会选不出的