PostgreSQL中IN和ANY运算符有什么区别?
两者的工作机制似乎是一样的.任何人都能用一个例子来解释这个吗
我正在尝试连接返回行的表和函数:
SELECT p.id, p.name, f.action, f.amount
FROM person p
JOIN calculate_payments(p.id) f(id, action, amount) ON (f.id = p.id);
Run Code Online (Sandbox Code Playgroud)
此函数为每个id返回0,1行或更多行.该查询适用于PostgreSQL 9.3,但在9.1上它显示以下错误:
Run Code Online (Sandbox Code Playgroud)ERROR: invalid reference to FROM-clause entry for table "p" HINT: There is an entry for table "p", but it cannot be referenced from this part of the query
我无法将函数中的计算移出到查询中.根据我的理解,我
不能使用JOIN LATERAL这是9.3中的新功能.
这个问题有解决方法吗?