R
R
Rashon Zhax2018-03-15 20:44:25
PHP
Rashon Zhax, 2018-03-15 20:44:25

How to make the top 5 most popular users? There is a database of users and subscriptions. PHP?

I have a user base (id = this is the user id). And the subscription base (fid = the one who subscribed. uid = the one who was subscribed to). How to make TOP-5 popular users with such data?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
doublench21, 2018-03-15
@doublench21

Well, based on these data, there is only one TOP. The number of subscriptions for a particular user.

N
Night, 2018-03-15
@maxtm

Select count(*) cnt, uid from tbl group by uid order by cnt desc

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question