SQLExpection 2018-10-17 11:03 采纳率: 33.3%
浏览 842
已采纳

mysql在一个字段确定的情况下随机获取n条数据怎么实现

<select id="selectqsContent" resultType="cn.yunding.yunjuan.entity.Question">
    select `qs_id`,`qs_content` from yj_question where type_id=#{typeId}
    order by read() limit #{n};
</select>
    我这样报错了

Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@57d108c] was not registered for synchronization because synchronization is not active
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@57d108c]

  • 写回答

1条回答 默认 最新

  • threenewbee 2018-10-17 13:29
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?