Oracle和SQL Server选择(+)等效项

wfveoks0  于 2022-11-03  发布在  Oracle
关注(0)|答案(2)|浏览(126)

在Oracle中,我拥有:

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中获得相同的结果?
谢谢

esyap4oy

esyap4oy1#

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
6ovsh4lw

6ovsh4lw2#

实际上,对我来说,这个问题看起来像是一个连接问题,在Oracle中,它被用作两个并排的管道:
Oracle:选择名字||“”||姓氏返回:John Doe(如果名字= John,姓氏= Doe)
与相同
MSSQL:选择名字+' '+姓氏返回:John Doe(如果名字= John,姓氏= Doe)

相关问题