Forked from enriquemanuel/users_notenrolled_notlog.sql
Last active
May 9, 2017 14:57
-
-
Save hanleybrand/bc2434d760fa7c87fb487a14166380bc to your computer and use it in GitHub Desktop.
Oracle SQL - Bb Learn - 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
-- Finding Users that have not logged in to the System and are not enrolled in any course | |
SELECT u.user_id, u.last_login_date | |
FROM BBLEARN.users u WHERE NOT EXISTS (SELECT pk1 FROM BBLEARN.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