Query for Users Without Managers
select distinct
usr1.usr_login,
usr1.usr_manager AS "Manager Name",
usr1.USR_CREATED
from usr usr1,usr usr2
where
usr1.usr_manager_key is null
union
select distinct
usr1.usr_login,
usr2.usr_first_name || ' '|| usr2.usr_middle_name|| ' '|| usr2.usr_last_name AS "Manager Name",
usr1.USR_CREATED
from usr usr1,usr usr2
where
usr1.usr_manager_key = usr2.usr_key
and usr1.usr_status not in ('Disabled', 'Deleted')
AND ((usr2.usr_status in ('Disabled', 'Deleted')))
Thanks!!!
select distinct
usr1.usr_login,
usr1.usr_manager AS "Manager Name",
usr1.USR_CREATED
from usr usr1,usr usr2
where
usr1.usr_manager_key is null
union
select distinct
usr1.usr_login,
usr2.usr_first_name || ' '|| usr2.usr_middle_name|| ' '|| usr2.usr_last_name AS "Manager Name",
usr1.USR_CREATED
from usr usr1,usr usr2
where
usr1.usr_manager_key = usr2.usr_key
and usr1.usr_status not in ('Disabled', 'Deleted')
AND ((usr2.usr_status in ('Disabled', 'Deleted')))
Thanks!!!
No comments:
Post a Comment