Using TOP
won't work with MySQL, because that is SQL Server (or maybe Access) syntax. You probably want LIMIT
here:
SELECT *
FROM yourTable
ORDER BY Likes DESC
LIMIT 3;
We could have also used:
LIMIT 3, OFFSET 0; -- three records with no offset
LIMIT 0, 3 -- same as above
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.