Hello,
I'm just desperate to output a query for active porn problems with different columns. The results should also show the value assigned to the user when the user is set, otherwise an empty value. But I only get the results of problems that have a user assigned to them. How can I query it correctly? Here my query:
<div>SELECT </div><div> Problem.Id_9A505725_E2F2_447F_271B_9B9F4F0D190C AS [Id],</div><div> Problem.Title_9691DD10_7211_C835_E3E7_6B38AF8B8104 AS Titel,</div><div> ProblemStageDisplayStringView.DisplayName AS Phase,</div><div> AssignedUser.DisplayName AS "Zugewiesen an",</div><div> Entity.LastModified AS "Zuletzt ge�ndert",</div><div> Problem.KnownError_4CE16CF0_5098_3CBD_3F72_72C2C5201FDB AS "KnownError",</div><div> ProblemSourceDisplayStringView.DisplayName AS "Quelle",</div><div> Problem.Priority_B930B964_A1C4_0B5A_B2D1_BFBE9ECDC794 AS "Priorit�t",</div><div> ProblemClassificationDisplayStringView.DisplayName AS "Klassifizierung"</div><br><div>FROM BaseManagedEntity AS Entity</div><br><div>--Problem</div><div>INNER JOIN dbo.MTV_System$WorkItem$Problem AS Problem ON Problem.BaseManagedEntityId = Entity.BaseManagedEntityId</div><br><div>--Phase</div><div>LEFT JOIN MT_ClassExtension_326d379e_299a_4014_8655_06e7831df05c AS ProblemStageExt ON ProblemStageExt.BaseManagedEntityId = Problem.BaseManagedEntityId</div><div>LEFT JOIN DisplayStringView AS ProblemStageDisplayStringView ON ProblemStageDisplayStringView.LTStringId = ProblemStageExt.Stage_564BBEA0_22D0_25DE_7126_F4FF26E91E5F AND ProblemStageDisplayStringView.LanguageCode = 'DEU'</div><br><div>--Source</div><div>LEFT JOIN DisplayStringView AS ProblemSourceDisplayStringView ON ProblemSourceDisplayStringView.LTStringId = Problem.Source_E310C86B_A6E0_816F_4E9D_F92D6E75EC7A AND ProblemSourceDisplayStringView.LanguageCode = 'DEU'</div><br><div>--Priority</div><div>LEFT JOIN DisplayStringView AS ProblemClassificationDisplayStringView ON ProblemClassificationDisplayStringView.LTStringId = Problem.Classification_C7A64916_0253_4710_4899_441928F6F2FA AND ProblemClassificationDisplayStringView.LanguageCode = 'DEU'</div><br><div>--AssignedUser</div><div>RIGHT JOIN Relationship AS Rel ON Rel.SourceEntityId = Entity.BaseManagedEntityId</div><div>INNER JOIN RelationshipType AS RelType ON RelType.RelationshipTypeId = Rel.RelationshipTypeId</div><div> AND RelType.RelationshipTypeName = 'System.WorkItemAssignedToUser'</div><div> AND Rel.IsDeleted = '0'</div><div>LEFT JOIN BaseManagedEntity AS AssignedUser ON AssignedUser.BaseManagedEntityId = Rel.TargetEntityId</div><br><div>WHERE</div><div> Problem.Status_3C8876F4_FCBF_148C_FBAF_4CF4F02C6187 = <span>'720438eb-ba08-1263-0944-6791fcb48991'</span></div>
I hope there is a SQL query expert out there :-)
It really makes me mad.
thanks in advance
Answers
[ServiceManager].[dbo].[MTV_System$WorkItem$Problem]
The script I shared does see the null for assigned to user and if null, it updates the displayed value to Unassigned for easy reading on the grid.
The left join is due to Cireson doesn't cache the Known issue Boolean