Not very proficient with SQL. I am trying to get username, count number of login attempts and the last date of login attempt from a database table. The table schema is something like this:
username character varying,
logindate timestamp,
result character varying,
clientip character varying
I was able to get the username and number of attempts from the following query:
SELECT USERNAME, COUNT(USERNAME) FROM LOGINTABLE GROUP BY USERNAME
Is it possible to get the date for last login from the same query? Please advice.
DB Used: POSTGRESQL
yes, use
MAX()