Error: SQL Substring with the "ON" Part of the JOIN

Error: SQL Substring with the "ON" Part of the JOIN

我正在使用 PostgreSQL 并且必须使用子字符串连接表。正如我在下面演示的那样,xyz.MODEL 和来自 abc Table 的“columnname”的前三个字符应该匹配。但是,下面的查询不起作用。

SELECT ..., ..., ..., ...
FROM ... AS abc
INNER JOIN ... AS xyz ON abc.SUBSTRING("columnname",1,3) = klm.MODEL

它returns错误:

ERROR:  schema "abc" does not exist

谁能帮我更正这个问题?

谢谢你的帮助。

table 别名必须在列名之前,而不是函数:

SELECT ...
FROM ... AS abc
  JOIN ... AS xyz ON SUBSTRING(abc."columnname",1,3) = klm.MODEL
                               ^
                               here