我有这个查询,它通过 focus.name ASC 对其进行排序来返回结果。我想对此进行扩展,首先按 rand() 排序,然后按 focus.name 排序并将其限制为 10。
$query = mysqli_query($db,"SELECT * FROM vendor_products WHERE
vendor_products.focus_id IN (SELECT focus.id FROM focus WHERE
focus.name='".mysqli_real_escape_string($db,$focus_name)."' AND
mydelete='0' ORDER BY focus.name ASC) AND product_id='".mysqli_real_escape_string($db,$product['id'])."'
AND mydelete='0' ORDER BY focus_id ASC");