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官方说明@H_403_3@
https://docs.oracle.com/cd/B19306_01/server.102/b14200/conditions012.htm@H_403_3@
EXISTS Condition
An EXISTS
condition tests for existence of rows in a subquery.@H_403_3@
Table 7-11 shows the EXISTS
condition.@H_403_3@
Table 7-11 EXISTS Condition@H_403_3@
Type of Condition | Operation | Example |
---|---|---|
EXISTS |
|
SELECT department_id FROM departments d WHERE EXISTS (SELECT * FROM employees e WHERE d.department_id = e.department_id); |