![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sql
心黑红卜萝
这个作者很懒,什么都没留下…
展开
-
mysql查询的结果表中在添加一列作为排序使用 @row_num
// 在结果表后在加一列递增一 作为排名使用 // 为了分页的时候排名是在整体数据上进行排序而不是每一页都是从1开始这个 @row_num应该是动态的 #{offset} 和limt #{offset} 一致 SET @row_num = 11; // 由于查询的条件中有group BY 排序sort如果在里面的话会乱序 所以要在结果上进行添加 sort SELECT result.*...原创 2018-11-09 15:41:04 · 2789 阅读 · 0 评论 -
mybatis 一对多查询 collention标签
//mapper中 <resultMap id="BaseResultMap" type="com.faceshow.modules.app.entity.AppActivityInfoEntity"> <id column="id" property="id" jdbcType="INTEGER"/&a原创 2018-11-21 16:27:40 · 273 阅读 · 0 评论 -
mysql根据指定规则排序
例: <choose> <when test="sidx != null and sidx.trim() != '' "> order by ${sidx} ${order} </when> <otherwise> ORDER BY FIELD(friendRingId, #{friendId}) desc // 我这里...原创 2019-09-04 17:43:56 · 1384 阅读 · 0 评论