我正在使用iBATIS创建select语句。现在我想用iBATIS实现以下SQL语句:
SELECT * FROM table WHERE col1 IN ('value1', 'value2');使用以下方法时,语句没有正确准备,并且没有返回结果:
SELECT * FROM table WHERE col1 IN #listOfValues#;iBATIS似乎重组了这个列表,并试图将其解释为一个字符串。
如何正确使用IN子句?
发布于 2009-10-28 23:06:14
怎么样
<select id="foo" parameterClass="Quuxly" resultClass="Flobitz">
select * from table
<dynamic prepend="where col1 in ">
<iterate property="list_of_values" open="('" close="')" conjunction=", ">
#list_of_values[]#
</iterate>
</dynamic>
</select>https://stackoverflow.com/questions/1637825
复制相似问题