Where does the Last Login exists for any user. We have a requirement where we want to find out that when was the last time a user logged in. I know I can find it from the workbench for each user but we want to a whole list of 400-500 users.
Here is some sql to get all users last login after Dec 31 09:
select u.username, la.creation_date FROM knta_logon_attempts la, knta_users u, (SELECT max(knta_logon_attempts.logon_attempt_id) as L_Login, knta_logon_attempts.username as who, knta_logon_attempts.user_id as who_id FROM knta_logon_attempts WHERE knta_logon_attempts.creation_date > '31-DEC-2009' GROUP BY knta_logon_attempts.username, knta_logon_attempts.user_id) maxlogin WHERE la.user_id = maxlogin.who_id and maxlogin.who = la.username and maxlogin.L_Login = la.logon_attempt_id and u.user_id = la.user_id ORDER BY u.username