Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 901
babboon Avatar asked Jun 12 '12 10:06

babboon


1 Answers

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
like image 95
Romil Kumar Jain Avatar answered Sep 20 '22 00:09

Romil Kumar Jain