我有一个这样的查询:
SELECT Id, Name, image, price, view FROM estore.product ORDER BY view DESC LIMIT 9
我想在该查询中选择随机 5 条记录。我试过了,但这段代码不起作用:
SELECT Id, Name, Image, Price, View FROM (
SELECT Id, Name, Image, Price, View FROM estore.product ORDER BY View DESC LIMIT 9)
ORDER BY RAND() LIMIT 5
我能怎么做?感谢收看?