Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hanleybrand/bc2434d760fa7c87fb487a14166380bc to your computer and use it in GitHub Desktop.
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
-- 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