babboon
babboon

Reputation: 793

Oracle and SQL Server select (+) equivalent

In Oracle I have:

SELECT t2.Regkood, t2.naitatel, t2.naitafaks, t3.lahtiolekuaeg, t1.*
FROM table1 t1, table2 t2, table3 t3
WHERE t1.client = t2.client AND t1.client = t3.client(+) AND t1.client = 414246

How do I get the same in SQL Server?

thanks

Upvotes: 5

Views: 15639

Answers (2)

Daniel Hudsky
Daniel Hudsky

Reputation: 301

Actually to me the question looks like a concatenate question which in Oracle is used as two pipes side by side:

Oracle: select FirstName||' '||LastName Returns: John Doe (if FirstName = John and LastName = Doe)

is the same as

MSSQL: select FirstName+' '+LastName Returns: John Doe (if FirstName = John and LastName = Doe)

Upvotes: 0

Romil Kumar Jain
Romil Kumar Jain

Reputation: 20745

SELECT t2.Regkood, 
       t2.naitatel, 
       t2.naitafaks, 
       t3.lahtiolekuaeg, 
       t1.* 
FROM   table1 t1 
       INNER JOIN table2 t2 
               ON t1.client = t2.client 
       LEFT JOIN table3 t3 
               ON t1.client = t3.client 
WHERE  t1.client = 414246 

Some samples to understand joins:

LEFT OUTER JOIN in ORACLE

SELECT *
FROM A, B
WHERE A.column = B.column(+)

RIGHT OUTER JOIN IN ORACLE

SELECT *
FROM A, B
WHERE A.column(+)=B.column

Upvotes: 8

Related Questions