SELECT t1.id,title,extName,cover,url FROM shop_articles AS t1 JOIN (SELECT ROUND(RAND() * ((SELECT MAX(id) FROM shop_articles)-(SELECT MIN(id) FROM shop_articles))+(SELECT MIN(id) FROM shop_articles)) AS id) AS t2 WHERE t1.id >= t2.id and type=_type ORDER BY t1.id LIMIT _num;