CREATE VIEW [Enterprise].[SelfSafeRankView]
AS SELECT ROW_NUMBER() OVER (PARTITION BY ssr.Id ORDER BY ssr.Id) AS Id, ssr.Id AS SelfSafeRankId,sr.Id AS SafeRankId,ssr.CompanyId,ssr.SelfSafeRankMinusScore,ssr.SelfSafeRankScore,sr.[Standard],sr.StandardScore,sr.ScoringWay,sr.According,sr.Comment,sr.Category
FROM [Enterprise].SelfSafeRank AS ssr
RIGHT JOIN [Enterprise].SafeRank AS sr
ON ssr.SafeRankId=sr.Id
AS SELECT ROW_NUMBER() OVER (PARTITION BY ssr.Id ORDER BY ssr.Id) AS Id, ssr.Id AS SelfSafeRankId,sr.Id AS SafeRankId,ssr.CompanyId,ssr.SelfSafeRankMinusScore,ssr.SelfSafeRankScore,sr.[Standard],sr.StandardScore,sr.ScoringWay,sr.According,sr.Comment,sr.Category
FROM [Enterprise].SelfSafeRank AS ssr
RIGHT JOIN [Enterprise].SafeRank AS sr
ON ssr.SafeRankId=sr.Id