postgreSQL - in vs any

后端 未结 2 768
灰色年华
灰色年华 2020-12-14 06:39

I have tried both

1) smthng = any(select id from exmplTable)

2) smthng in (select id from exmplTable)

2条回答
  •  我在风中等你
    2020-12-14 07:06

    This may be an edge case but:

    select * from myTable where id IN ()
    

    will produce: ERROR: syntax error at or near ")"

    but

    select * from myTable where id = ANY('{}');
    

    Will return an empty result set

提交回复
热议问题