MyBatis之动态SQL

动态SQL之foreach

  • 有时SQL语句where条件是在一个集合或者数组里,需要使用in关键字,这时可以使用foreach动态SQL语句,例如:
    select * from person where id in
    <foreach collection="array" item="id" index="i" open="(" close=")" separator=",">
        #{id}
    </foreach>
    

相关文章:

  • 2022-12-23
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2021-08-17
  • 2021-12-01
  • 2022-01-24
猜你喜欢
  • 2021-11-11
  • 2022-12-23
  • 2022-03-06
  • 2021-12-02
  • 2022-01-08
  • 2021-06-24
  • 2021-10-31
相关资源
相似解决方案