Skip to content
Partner Developer Portal

Definition

The Dbo User model holds user identity and account details, including names, email address, sex, login name and user identifiers. It also records automatic-login, system-user, EMIS-distributed and deleted flags, alongside a flag concerning skipped password-reset security details and organisation information.

_deleted indicates whether the record has been deleted in the source system.

Count related dbo.useridentifier records for each dbo.user record, joined on userid.

SELECT
m."userid",
m."displayname",
COUNT(c."userid") AS useridentifier_count
FROM dbo.user AS m
LEFT JOIN dbo.useridentifier AS c
ON m."userid" = c."userid"
AND m."organisation" = c."organisation"
GROUP BY m."userid", m."displayname"
ORDER BY useridentifier_count DESC;

dbo.useridentifier records with dbo.user details

Section titled “dbo.useridentifier records with dbo.user details”

List dbo.useridentifier records with the dbo.user values they reference through userid.

SELECT
c."_primary_key",
m."userid",
m."displayname" AS "user_displayname"
FROM dbo.useridentifier AS c
INNER JOIN dbo.user AS m
ON m."userid" = c."userid"
AND m."organisation" = c."organisation";

Count related dbo.userinrole records for each dbo.user record, joined on userid.

SELECT
m."userid",
m."displayname",
COUNT(c."userid") AS userinrole_count
FROM dbo.user AS m
LEFT JOIN dbo.userinrole AS c
ON m."userid" = c."userid"
AND m."organisation" = c."organisation"
GROUP BY m."userid", m."displayname"
ORDER BY userinrole_count DESC;