postgresql 列“a.ParcelID”不存在

nhaq1z21  于 2023-03-29  发布在  PostgreSQL
关注(0)|答案(1)|浏览(158)
SELECT "a.ParcelID", "a.PropertyAddress", "b.ParcelID", "b.PropertyAddress",            isnull("a.PropertyAddress", "b.PropertyAddress")
from data "a"
join data "b"
on "a.ParcelID" = "b.ParcelID"
and "a.ID" <> "b.ID"    
where "a.PropertyAddress" is null

对于上面的代码,它显示我错误的任何解决方案

ERROR:  column "a.ParcelID" does not exist
LINE 4: on "a.ParcelID" = "b.ParcelID"
       ^
HINT:  Perhaps you meant to reference the column "a.ParcelID" or the column "b.ParcelID".
vom3gejh

vom3gejh1#

使用双引号时不要包含表别名,例如a."ParcelID"a."PropertyAddress"
一般来说,建议避免使用需要用引号开始的列名。

相关问题