select t.a2 from table1 t
where t.a1 = 本月
minus
select t1.a2 from table1 t1
where t1.a1 = 上月;
这样试试
where t.a1 = 本月
minus
select t1.a2 from table1 t1
where t1.a1 = 上月;
这样试试
解决方案 »
- oracle连接求助
- 求助oracle 数据库中创建表空间 出现错误"ORA-00905:缺失关键字"
- Oracle8.0.5(for nt)有没有和MSSQL2000类似的显示预定的执行计划(查询成本)?
- 批量更新有重复记录,怎么办
- 【请高手指教!】夜维删除多个表小部分(1/10的百万级)记录的案例
- 数据仓库主题模型
- 着急啊!!如何根据表名从系统表里面取出主键对应的字段名称??
- 我是一个新手,望大家多多帮助。
- 请问在奔四机上安装Oracle8.17的兼容性问题(在线等)
- win7x64 oracle11g汉字显示?
- 请教如何用SQL得到用户建立的视图?谢谢
- oracle9i 执行sql 错误,导致服务器cpu使用率 100% .
select * from table1 t
where t.a1 = 本月
and t.a2 not exist(select t1.a2
from table1 t1
where t1.a1 = 上月)但感觉奇怪
select * from table1 t where t.a1 = 本月
与
select t1.a2 from table1 t1 where t1.a1 = 上月
没关系!
select * from table1 t
where t.a1 = 本月
and not exist (select t1.a2 from table1 t1
where t1.a1 = 上月 and t1.a2 = t.a2)