【Mybatis】【7】order by 使用动态参数时需要注意,用${}而不是#{}

时间:2019-05-26 23:36:25   收藏:0   阅读:305

正文:

-- 正确写法
SELECT * FROM TABLE WHERE ID = #{id} ORDER BY ${columnName} DESC

参考博客:

MyBatis排序时使用order by 动态参数时需要注意,用$而不是# - pyzheng - ITeye博客
https://panyongzheng.iteye.com/blog/2257412

原文:https://www.cnblogs.com/huashengweilong/p/10924936.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!