Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/8.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 错误:表“”的子句条目中缺少;cte“;在CTE中执行查询时_Postgresql_Common Table Expression - Fatal编程技术网

Postgresql 错误:表“”的子句条目中缺少;cte“;在CTE中执行查询时

Postgresql 错误:表“”的子句条目中缺少;cte“;在CTE中执行查询时,postgresql,common-table-expression,Postgresql,Common Table Expression,我试图在Postgresql上执行以下操作 我越来越 ERROR: missing FROM-clause entry for table "cte" 单击查看我的原始代码如果未在tempstockpos中定义cte表,则不会在tempstockpos中看到该表。现在显示整个代码。而不是tempstockpos中的,其中。。。。并且tempstockpos.batchid=cte.batchid,则必须在FROM子句中包含cte,如: FROM tempstockpos, cte

我试图在Postgresql上执行以下操作

我越来越

    ERROR:  missing FROM-clause entry for table "cte"

单击查看我的原始代码

如果未在
tempstockpos
中定义
cte
表,则不会在
tempstockpos
中看到该表。现在显示整个代码。

而不是tempstockpos中的
,其中。。。。并且tempstockpos.batchid=cte.batchid
,则必须在
FROM
子句中包含
cte
,如:

FROM tempstockpos, cte WHERE .... AND tempstockpos.batchid = cte.batchid
或者优选更清洁且更可读的:

FROM tempstockpos INNER JOIN cte ON  tempstockpos.batchid = cte.batchid WHERE ....

在代码中显示您的查询以及什么是
tempstockpos
请不要以图片形式发布代码,发布格式化文本。@下次我将使用带有\u no \u名称的\u horse \u,因为我的代码非常大,所以我不会尝试在此处更新,所以单击此处查看