加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

oracle exists 条件查询

发布时间:2020-12-12 15:47:54 所属栏目:百科 来源:网络整理
导读:select /*+index(table_a columna)*/ distinct tx_oper_idfrom table_awhere not exists(select *fromtable_bwhere b.id=a.id) 参考Oracle官方说明 https://docs.oracle.com/cd/B19306_01/server.102/b14200/conditions012.htm EXISTS Condition An EXISTS c
EXISTS

TRUE if a subquery returns at least one row.

SELECT department_id
  FROM departments d
  WHERE EXISTS
  (SELECT * FROM employees e
    WHERE d.department_id 
    = e.department_id);

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

select /*+index(table_a columna)*/ distinct tx_oper_id
from table_a
where not exists(
select *
from
table_b
where b.id=a.id
)

参考Oracle官方说明

https://docs.oracle.com/cd/B19306_01/server.102/b14200/conditions012.htm

EXISTS Condition

An EXISTS condition tests for existence of rows in a subquery.


Table 7-11 shows the EXISTS condition.

Table 7-11 EXISTS Condition

Type of Condition Operation Example
    推荐文章
      热点阅读