我尝试将标准表与临时表连接起来:
这是我尝试过的:
with temp1 as (
select * from table T )
select * from temp1, t2.field
left join temp1 t2 on temp1.id1 = t2.id2
它不能正常工作。有任何想法吗 ?
谢谢你们。
我尝试将标准表与临时表连接起来:
这是我尝试过的:
with temp1 as (
select * from table T )
select * from temp1, t2.field
left join temp1 t2 on temp1.id1 = t2.id2
它不能正常工作。有任何想法吗 ?
谢谢你们。
sql 的语法是 select from where。您在此处写的内容为 select from select from。将 t2.field 移出 from 子句并进入 select。
with temp1 as (
select * from table T )
select temp1.*, t2.field from temp1
left join temp1 t2 on temp1.id1 = t2.id2
尝试这个
WITH TEMP1 AS (SELECT * FROM TABLET)
SELECT
*
FROM
TEMP1 LEFT JOIN T2 ON ( TEMP1.ID1 = T2.ID2 )