Problem on Select, pick one, skip others
Kindly need your help to solve my problem, i have task to query from database.
The problem is, i have subquery that will pick granted role.
in subquery, if user has more than one role, i should pick only one role from him.
my initial subquery is :
select granted_role, grantee from dba_role_privs where grantee in ( select username from v$session) On that query, if somone has more than one privilege, the data will show all of his role.Can you help me how to make the correct query, so the data will only pick the first role that granted to the grantee and skip the other roles?