我试着问
SELECT id FROM events WHERE iid = 2 AND target_id = 3 OR iid = 3 AND target_id = 5 OR...
如何缩短这个?也尝试过在运算符中使用,但逻辑错误
SELECT id FROM events where iid IN (2, 3) AND target_id IN (3, 5)
rkttyhzu1#
postgres支持元组相等:
select id from events where (iid, target_id) in ( (2, 3), (3, 5) )
1条答案
按热度按时间rkttyhzu1#
postgres支持元组相等: