5

在甲骨文我有:

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

我如何在 SQL Server 中获得相同的结果?

谢谢

4

1 回答 1

8
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 

一些了解连接的示例:

ORACLE 中的左外连接

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

ORACLE 中的右外连接

SELECT *
FROM A, B
WHERE A.column(+)=B.column
于 2012-06-12T10:06:06.607 回答