MySQL 随机查询10条数据

阅读 29

2024-01-24

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)

0 0 举报