Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么在Postgresql v9.5中,交叉联接不能作为带有jsonb_数组_元素的笛卡尔产品使用_Sql_Postgresql - Fatal编程技术网

为什么在Postgresql v9.5中,交叉联接不能作为带有jsonb_数组_元素的笛卡尔产品使用

为什么在Postgresql v9.5中,交叉联接不能作为带有jsonb_数组_元素的笛卡尔产品使用,sql,postgresql,Sql,Postgresql,这是我的演示sql。 我想展平json数组并映射到其父级 select * from Orders CROSS JOIN LATERAL jsonb_array_elements(data->'products') as product_item; 这个sql可以按照我的要求工作,但我不知道为什么它可以工作。 为什么不指定表就可以交叉连接? 是db FIDLE错误还是postgresql内部工作方式?它也可以在我的笔记本电脑上使用 谢谢。您确实有一个表-由jsonb\u arr

这是我的演示sql。

我想展平json数组并映射到其父级

select * from Orders
    CROSS JOIN LATERAL jsonb_array_elements(data->'products') as product_item;
这个sql可以按照我的要求工作,但我不知道为什么它可以工作。
为什么不指定表就可以交叉连接?
是db FIDLE错误还是postgresql内部工作方式?它也可以在我的笔记本电脑上使用


谢谢。

您确实有一个表-由
jsonb\u array\u elements()返回的表。
谢谢您的回复。但是,与左连接一样,我需要显式声明,例如
select*fromtable1leftjointtable2
。为什么交叉联接不仅可以这样工作?我在文档中没有找到任何线索。您也可以从表1中的左连接横向jsonb_数组_元素(…)在…另一个问题是交叉连接应该是N*M?