J
J
Junior2019-01-06 19:30:47
SQL
Junior, 2019-01-06 19:30:47

How to implement it (PHP, SQL)?

There are 2 tables users and posts.
You need to display the login of the most active user per day, that is, the one with the largest number of posts per day. How can this be implemented?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Bay, 2019-01-06
@kawabanga

With the first request, you pull the top active user ids, and either join, or simply select the second one, take the users.

select user_id, count(id) as count_ids from posts where `datetime`>{день назад} order by count_ids desc  limit 10

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question