Answered step by step
Verified Expert Solution
Link Copied!

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.image text in transcribed

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_tags

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions