Need help in below query:
My requirement is, if role\_id is existing for a user in si\_org\_roles ( first union), then no need to pick up data from audit tables 
( its used for list of user deleted from a role) and note that a user can have multiple org - role, ie. org-role to role is many - one relationship.

```
SELECT  m.user_id, m.org_role_id, m.last_update_date,ro.role_id 
FROM si_user_org_roles m,si_org_roles ro where m.org_role_id = ro.org_role_id 
and ro.role_id = 100074
union 
SELECT  au.user_id_o,
  au.org_role_id_o,
  au.last_update_date_o,
  ru.role_id
FROM si_user_org_roles_au au,si_org_roles ru
WHERE au.transaction_type = 'Delete'
and au.org_role_id_o = ru.org_role_id

```