-2

I have this Oracle code, which I need to convert to SQL Server:

FROM 
    dbo.userid t,
    dbo.securityuser us,
    dbo.dbaudit dba
WHERE 
    t.userid = us.userid
    t.userid = dba.keyvalue(+)

I have a problem with

t.userid = dba.keyvalue(+) 

Here the plus operator is after the column and the left joins are done using

table1.col(+) = table2.col

Please help me to understand what actually it is doing.

Thom A
  • 88,727
  • 11
  • 45
  • 75
  • 2
    [Bad Habits to Kick : Using old-style JOINs](https://sqlblog.org/2009/10/08/bad-habits-to-kick-using-old-style-joins) – Thom A Apr 30 '21 at 15:23

1 Answers1

3

I think you want:

FROM dbo.userid t JOIN
     dbo.securityuser us
     ON  t.userid = us.userid LEFT JOIN
     dbo.dbaudit dba
     ON t.userid = dba.keyvalue
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786