Definition
Information
Section titled “Information”The Admin Teamuserinrole model records team membership for users in their recorded roles. It holds the team identifier and user-in-role identifier for that membership, together with the organisation information recorded for the association between the team and user role.
Soft-Deleted Records
Section titled “Soft-Deleted Records”_deleted indicates whether the record has been deleted in the source system.
Examples
Section titled “Examples”admin.teamuserinrole with admin.team and dbo.userinrole details
Section titled “admin.teamuserinrole with admin.team and dbo.userinrole details”Return records alongside descriptive values from the related tables.
SELECT m."_primary_key", m."teamid", p1."description" AS "team_description", m."userinroleid", p2."contractualrelationship" AS "userinrole_contractualrelationship"FROM admin.teamuserinrole AS mLEFT JOIN admin.team AS p1 ON p1."teamid" = m."teamid" AND p1."organisation" = m."organisation"LEFT JOIN dbo.userinrole AS p2 ON p2."userinroleid" = m."userinroleid" AND p2."organisation" = m."organisation";Row count by admin.team description
Section titled “Row count by admin.team description”Count admin.teamuserinrole records for each admin.team value, joined on teamid.
SELECT p."description" AS "team_description", COUNT(*) AS row_countFROM admin.teamuserinrole AS mINNER JOIN admin.team AS p ON p."teamid" = m."teamid" AND p."organisation" = m."organisation"GROUP BY p."description"ORDER BY row_count DESC;Row count by dbo.userinrole contractualrelationship
Section titled “Row count by dbo.userinrole contractualrelationship”Count admin.teamuserinrole records for each dbo.userinrole value, joined on userinroleid.
SELECT p."contractualrelationship" AS "userinrole_contractualrelationship", COUNT(*) AS row_countFROM admin.teamuserinrole AS mINNER JOIN dbo.userinrole AS p ON p."userinroleid" = m."userinroleid" AND p."organisation" = m."organisation"GROUP BY p."contractualrelationship"ORDER BY row_count DESC;