Mysql Enterprise list sorting problem (sorted by the total number of people logged in within 7 days)?

demand:

 

collation

7 7

Table structure:
Company Table: id, name (Company name)
user Table: user_id, company_id (company association ID), last_login (last login time)

Mar.10,2021
Menu