How to Retrieve analysts that are not members of any groups
SELECT ca_contact.userid, ca_contact.first_name, ca_contact.last_name, acctyp_v2.licensed, acctyp_v2.access_level, acctyp_v2.sym AS access_typeFROM usp_contact INNER JOIN ca_contact ON usp_contact.contact_uuid = ca_contact.contact_uuid LEFT OUTER JOIN acctyp_v2 ON usp_contact.c_acctyp_id = acctyp_v2.idWHERE (acctyp_v2.access_level >= 20) AND (acctyp_v2.licensed = 1) AND (ca_contact.inactive <> 1) AND ((SELECT COUNT(*) AS Expr1 FROM grpmem WHERE (member = usp_contact.contact_uuid)) = 0)
By Jerome Mayer
Summary CA SDM MS SQL Querys - TSQL