MySQL 随机查询10条数据

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>

你可能感兴趣的:(Java,mysql,数据库,java)