【发布时间】:2015-05-22 03:32:26
【问题描述】:
我正在尝试在 Postgresql 中加入 2 个表。 table1 中的 col1 是字符变量类型,表 2 中的 col2 是字符变量 []
类型有人知道为什么使用 IN 运算符不起作用吗?
这是查询:
SELECT t1.*, t2.*
FROM table1 t1 INNER JOIN table2 t2
ON t1.col1 in t2.col2
这是错误:
ERROR: syntax error at or near "t2"
另外,
SELECT t1.*, t2.*
FROM table1 t1 INNER JOIN table2 t2
ON t1.col1 in unnest(t2.col2)
失败
ERROR: syntax error at or near "unnest"
【问题讨论】:
标签: postgresql join