1
I have two tables, one user
and another visitas
. On the table visitas
i save the ID of the user that was visited and who visited.
How to make a query where I leave users in order of more number of visits? I do not keep the total anywhere
Any hint?
I don’t know how the structure is but I believe that a
count()
with agroup by
resolve.– rray
Edit the question to include important details. For example: what is a visit? does a user visit another? Do you have one line per visit for each user? If you provide the ER model of the tables, maybe someone can respond directly with the SQL expression that can help you. Otherwise, many interactions of comments are required.
– Luiz Vieira