Query to show list of contacts that are assigned to an account but not have a login

Query to show list of contacts that are assigned to an account but not have a login

The below query shows the list of contacts that are assigned to an account, but does not have a login. 


SELECT org.NAME AS "Account Name" ,aaauser.FIRST_NAME AS " Contact with no login" FROM AaaUser aaauser LEFT JOIN AaaUserContactInfo user_contact ON aaauser.USER_ID=user_contact.USER_ID LEFT JOIN AaaContactInfo ucinfo ON user_contact.CONTACTINFO_ID=ucinfo.CONTACTINFO_ID LEFT JOIN SDUser sduser ON aaauser.USER_ID=sduser.USERID LEFT JOIN Customer_Requester custreq ON sduser.USERID=custreq.REQUESTER_ID LEFT JOIN Customer cust ON custreq.CUSTOMER_ID=cust.CUSTOMER_ID LEFT JOIN AaaOrganization org ON cust.CUSTOMER_ID=org.ORG_ID LEFT JOIN DepartmentUser dep_user ON sduser.USERID=dep_user.USERID  left join aaalogin aaalogin on aaauser.user_id=aaalogin.user_id where aaauser.first_name not in (select name from aaalogin) and org.NAME not like '%Not Assigned%'


                  New to ADSelfService Plus?