以下查询两个匿名表运行:加入相互
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