Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please re-write below query in Teradata with pivot. SELECT SuggestionID , [1] AS 'Tag 1' , [2] AS'Tag 2' [3] AS 'Tag 3 , [4]
Please re-write below query in Teradata with pivot.
SELECT SuggestionID , [1] AS 'Tag 1' , [2] AS'Tag 2' [3] AS 'Tag 3 , [4] AS 'Tag 4 [5] AS Tag 5 FROM ( SELECT ROW_NUMBER() OVER(PARTITION BY st.suggestionid ORDER BY st. suggestionid, st.ID ASC) AS SuggestionTagNum , st.suggestionid ,t.tag FROM CRPBP.LoudSpeaker.LS_SuggestionTag st INNER JOIN CRPBP.LoudSpeaker.LS_Tag t ON st.TagID = t.ID ) tag PIVOT 1 MIN(tag) FOR SuggestionTagNum IN [[1],[2],[3],[4],[5]) ) As pivoted_tagsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started