Categories
Mysql How to display the number of authorizations (count) per user?
There is a database with fields Auth_date, Login, IP, each time we log in, we add data there. Tell me how to display the number of authorizations per user?
Answer the question
In order to leave comments, you need to log in
COUNT, GROUP BY
SELECT u.login, count(a.auth_date) FROM users u JOIN auth_table a ON u.login = a.login WHERE -- какое-то условие GROUP BY u.login
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question