Files
server/src/Sql/dbo/Views/OrganizationUserUserDetailsView.sql

21 lines
524 B
MySQL
Raw Normal View History

2017-03-06 20:51:13 -05:00
CREATE VIEW [dbo].[OrganizationUserUserDetailsView]
2017-03-04 21:28:41 -05:00
AS
SELECT
OU.[Id],
OU.[UserId],
OU.[OrganizationId],
U.[Name],
ISNULL(U.[Email], OU.[Email]) Email,
U.[TwoFactorProviders],
U.[Premium],
2017-03-04 21:28:41 -05:00
OU.[Status],
OU.[Type],
2017-05-15 23:03:32 -04:00
OU.[AccessAll],
OU.[ExternalId],
SU.[ExternalId] SsoExternalId
2017-03-04 21:28:41 -05:00
FROM
[dbo].[OrganizationUser] OU
LEFT JOIN
[dbo].[User] U ON U.[Id] = OU.[UserId]
LEFT JOIN
[dbo].[SsoUser] SU ON SU.[UserId] = OU.[UserId] AND SU.[OrganizationId] = OU.[OrganizationId]