Definition
Information
Section titled “Information”The Dbo Organisationteam model records associations between organisations and teams. Each entry holds the organisation identifier and team identifier together, alongside the organisation information recorded for that entry, representing an organisation-team association rather than the descriptive details of either.
Soft-Deleted Records
Section titled “Soft-Deleted Records”_deleted indicates whether the record has been deleted in the source system.
Examples
Section titled “Examples”dbo.organisationteam with dbo.organisation and admin.team details
Section titled “dbo.organisationteam with dbo.organisation and admin.team details”Return records alongside descriptive values from the related tables.
SELECT m."_primary_key", m."organisationid", p1."organisationdisplayname" AS "organisationdisplayname", m."teamid", p2."description" AS "team_description"FROM dbo.organisationteam AS mLEFT JOIN dbo.organisation AS p1 ON p1."organisationid" = m."organisationid" AND p1."organisation" = m."organisation"LEFT JOIN admin.team AS p2 ON p2."teamid" = m."teamid" AND p2."organisation" = m."organisation";Row count by dbo.organisation organisationdisplayname
Section titled “Row count by dbo.organisation organisationdisplayname”Count dbo.organisationteam records for each dbo.organisation value, joined on organisationid.
SELECT p."organisationdisplayname" AS "organisationdisplayname", COUNT(*) AS row_countFROM dbo.organisationteam AS mINNER JOIN dbo.organisation AS p ON p."organisationid" = m."organisationid" AND p."organisation" = m."organisation"GROUP BY p."organisationdisplayname"ORDER BY row_count DESC;Row count by admin.team description
Section titled “Row count by admin.team description”Count dbo.organisationteam records for each admin.team value, joined on teamid.
SELECT p."description" AS "team_description", COUNT(*) AS row_countFROM dbo.organisationteam 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;