0
点赞
收藏
分享

微信扫一扫

MySQL 随机查询10条数据

一只1994 2024-01-24 阅读 20

1.rand()

  随机查询10条数据:ORDER BY RAND() LIMIT 10

	<select id="getRecommendProductList" resultType="com.xxx.xxx.front.response.ConvertRecommendProductList">
        select
        	*
        from
        	store_product
        where
        	1=1
        ORDER BY RAND() LIMIT 10
    </select>
举报

相关推荐

0 条评论