How to use IN clause with PreparedStatement in PostgreSQL

后端 未结 3 767
北恋
北恋 2020-12-18 22:49

I have to write a SQL query for Postgres database as follows:

DELETE FROM employee WHERE ename IN (?)

I want to pass ename as

3条回答
  •  温柔的废话
    2020-12-18 23:51

    Like this:

    DELETE FROM employee WHERE ename = ANY(?)
    

    The parameter should be formatted as an array literal, e.g. "{abc,bcd,efg}".

提交回复
热议问题