我是Oracle新手,我正在尝试复制一种非常有用的查询类型,我总是在SQL Server中使用它。
我正在尝试在Oracle中找到此查询的等效项
; With tablename as (
Select
Column1 ,
Column2
From table1
)
, with tablename2 as (
Select
column3,
Column4
)
Select
Column 2 ,
column 4
from Tablename t1
left outer join tablename t2
on t1.column1 = t2.column3
答案 0 :(得分:2)
您有一些错误(列名称中的空格,缺少FROM,...)。 这应该有效:
WITH tablename AS (SELECT Column1, Column2 FROM table1),
tablename2 AS (SELECT column3, Column4 FROM table2)
SELECT Column2, column4
FROM Tablename t1 LEFT OUTER JOIN tablename t2 ON t1.column1 = t2.column3