以下查詢兩個匿名錶運行:加入相互
select foo.g from (select 'hello' as g) as foo
與此查詢藏漢運行:
select bla.x from (select 'world' as x) as bla
但是這一次沒有:
select * from (select foo.g from (select 'hello' as g) as foo) join (select bla.x from (select 'world' as x) as bla)
我得到的以下錯誤信息:
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'join'.
爲什麼是錯誤?有沒有可能以某種方式加入這些表格?
表,但你可以在postgres中做到這一點:'select * from foo join bar',其中foo和bar是表格。 – reox
我缺乏關於postgres的知識,但是沒有過濾器的連接表的獨特方式是交叉連接(錶行之間的笛卡爾積)。這似乎是它。 – jean
啊我明白了!所以命名不同 – reox