I am using mysql. I have one table called flow_data There is two attributes category and views. category is int type and views is int type. category has 0-4(for example num 0 is video and num 1 is pics) and numbers of view is based on how many times users click. I want to query data that top5 views for each category.
SELECT DISTINCT id, cat, title, file, type, tags
FROM flow_data
ORDER BY views
LIMIT 5
It only returns top5 views not based on each category.
Any thought? Thank you advance.
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.