Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does (+) mean in SQL?

Tags:

sql

What does the (+) mean in the Where Clauses in this SQL statement?

SELECT  p.FIRSTNAME,
        p.LASTNAME,
        p.LOGINNAME,
        a.DESCRIPTION,
        a.PERIPHERALNUMBER,
        a.SUPERVISORAGENT,
        t.ENTERPRISENAME,
        t.DIALEDNUMBERID,
        sp.FIRSTNAME AS SUPER_FIRSTNAME,
        sp.LASTNAME AS SUPER_LASTNAME,
        sp.LOGINNAME AS SUPER_LOGINNAME,
        sa.PERIPHERALNUMBER AS SUPER_PERIPHERALNUMBER,
        sa.SUPERVISORAGENT AS SUPER_SUPERVISORAGENT,
        a.SKILLTARGETID,
        a.PERSONID,
        t.AGENTTEAMID,
        sa.SKILLTARGETID AS SUPER_SKILLTARGETID,
        sa.PERSONID AS SUPER_PERSONID
FROM    C2O.AGENT a,
        C2O.PERSON p,
        C2O.AGENT_TEAM_MEMBER tm,
        C2O.AGENT_TEAM t,
        C2O.AGENT sa,
        C2O.PERSON sp
WHERE   a.PERSONID = p.PERSONID
AND     a.SKILLTARGETID = tm.SKILLTARGETID(+)
AND     tm.AGENTTEAMID = t.AGENTTEAMID(+)
AND     t.PRISUPERVISORSKILLTARGETID = sa.SKILLTARGETID(+)
AND     sa.PERSONID = sp.PERSONID(+)
AND     a.DELETED = 'N'
AND     p.LOGINENABLED = 'Y'
AND     SUBSTR(a.PERIPHERALNUMBER,2,3) = 580;
like image 781
muncherelli Avatar asked Aug 23 '10 16:08

muncherelli


2 Answers

In Oracle, the (+) specifies that the join is an outer join (instead of an inner join as this implicit join syntax usually implies).

Making it an outer join means that the row should be included in the results even if that particular item is null.

like image 59
Jacob Mattison Avatar answered Oct 01 '22 18:10

Jacob Mattison


In Oracle SQL, this is the deprecated outer join operator.

like image 30
meriton Avatar answered Oct 01 '22 19:10

meriton