Le rôle exact du (+) dans une clause est de spécifier une jointure externe à gauche (left outer join) dans une requête SQL.
mathanz
Posted messages
1
Status
Member
-
mathanz -
mathanz -
Hello,
could someone explain to me precisely the role of the "(+)" in the following query please?
select * from table1 t, table2 t2 where
t.t1 = 'toto' AND
t.t2 > 3 AND
t.t4(+) = t2.t1
Thank you!
could someone explain to me precisely the role of the "(+)" in the following query please?
select * from table1 t, table2 t2 where
t.t1 = 'toto' AND
t.t2 > 3 AND
t.t4(+) = t2.t1
Thank you!
2 answers
Hello,
This syntax is used to include in the result the rows where the field t.t4 is not filled in (set to null). These rows are therefore added to the result in addition to those that meet the condition.
This is called an Outer Join:
When a row from one table in a join has no corresponding match in the other tables, it does not meet the equi-join criteria and thus does not appear in the results of the join. An option allows you to include in the result the rows that meet the equi-join condition plus those without a match. This option is achieved by appending (+) to the column name of the table from which elements are missing, in the equi-join condition.
Regards
This syntax is used to include in the result the rows where the field t.t4 is not filled in (set to null). These rows are therefore added to the result in addition to those that meet the condition.
This is called an Outer Join:
When a row from one table in a join has no corresponding match in the other tables, it does not meet the equi-join criteria and thus does not appear in the results of the join. An option allows you to include in the result the rows that meet the equi-join condition plus those without a match. This option is achieved by appending (+) to the column name of the table from which elements are missing, in the equi-join condition.
Regards