Created
August 19, 2014 23:45
-
-
Save enriquemanuel/7cf9443d5df8abdb6651 to your computer and use it in GitHub Desktop.
SQL - BB - Finding Users that have not logged in to the System and are not enrolled in any course
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT u.user_id, u.last_login_date | |
FROM users u WHERE NOT EXISTS (SELECT pk1 FROM course_users WHERE users_pk1=u.pk1 ) | |
and u.last_login_date is null | |
-- and u.system_role = 'N' -- if we want to limit by the system role | |
order by user_id asc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment