NOTE: I highly recommend using a SQL client like pgAdmin or MySQL Workbench
Update: If you want to find out how many people have logged into your Mattermost server in the last 90 days this query is much more perfomant than the one using the Audits
table:
MySQL
SELECT COUNT(*)