“WHERE x IN y” clause with dapper and postgresql throwing 42601: syntax error at or near \“$1\”

前端 未结 1 1579
故里飘歌
故里飘歌 2020-12-16 12:39

I have an array of strings, and I\'d like to have a query containing an IN clause, like:

\"... WHERE t.name IN (\'foo\', \'bar\', \'baz\')..>\"

相关标签:
1条回答
  • 2020-12-16 13:02

    In PostgreSQL, you can't use IN to check whether a value is inside an array, you have to use the following PostgreSQL-specific syntax: where t.name = ANY (@tagsParam). See the section 8.15.5 in the PostgreSQL docs.

    0 讨论(0)
提交回复
热议问题