tsql - T-SQL View to select FULL OUTER JOIN and add additional rows on "A" based on "B" table -
I hope someone can help me.
I need to solve the problem with a sequence, based on the following scenario.
I have two tables: Report Statement Result I want this to happen: Any help would be greatly appreciated. language
and ReportDescription
Pre> ID Tag Description ---- ---- ---------------- 1 en English 2D German 3 French 4 This Italian
LanguageEnd report ID details ---------- ------ ----- - ------------------ 1 Committee (Engineering) 2 1 Committee (German) 3 1 Committee (French) 4 1 Committee (ITA) 1 2 Appointment (Engineering) < / Code>
Language Indic Port ID Details ----- ----- ----------- ------------------- 1 Committee of 1 (Engineering ) 2 1 Committee (German) 3 1 Committee (French) 4 1 Committee (ITA) 1 2 Appointment (Engineering) 2 2 Appointment (Engineering) 3 2 Appointment (Engineering) 4 2
If you have a specific report that is not available in a particular language, then this query will: Details as
SELECT rd.LanguageId, rd.ReportId, COALESCE (r.Description, (WHERE ReportDescription.ReportId = rd.ReportId and LanguageId = 1 written in the report from selection details)) (Selection difference report ID, Language written in the form of language, Language L) RD LEFT JOIN ReportDescription Rd.LanguageId = Language ID and rd.ReportId = R.ReportId by command rd.ReportId, Rd.LanguageId
come the default language May be English in question (do not forget to add Spanish support ;-)).
Comments
Post a Comment