Oracle “(+)” Operator

前端 未结 4 564
礼貌的吻别
礼貌的吻别 2020-11-22 11:56

I am checking some old SQL Statements for the purpose of documenting them and probably enhancing them.

The DBMS is Oracle

I did not understand a statement wh

4条回答
  •  孤街浪徒
    2020-11-22 12:39

    The (+) operator indicates an outer join. This means that Oracle will still return records from the other side of the join even when there is no match. For example if a and b are emp and dept and you can have employees unassigned to a department then the following statement will return details of all employees whether or not they've been assigned to a department.

    select * from emp, dept where emp.dept_id=dept.dept_id(+)
    

    So in short, removing the (+) may make a significance difference but you might not notice for a while depending on your data!

提交回复
热议问题