I am using teradata.
This is what I want to do:
SELECT
'Total ' as Row_One
, Name
, Sum (Column2) Column2_Sum
, Sum (Column3) Column3_Sum
, Sum (Column4) Column4_Sum
, (Column2_Sum + Column3_Sum + Column4_Sum) Total_Sum
, Rank (Total_Sum) Total_Sum_Rank
FROM
GROUP BY Name
ORDER BY Total_Sum DESC
Qualify Total_Sum_Rank <= 10
i know this code won't work because you can't + in a select. how can i duplicate the logic?
This is what I want to do:
SELECT
'Total ' as Row_One
, Name
, Sum (Column2) Column2_Sum
, Sum (Column3) Column3_Sum
, Sum (Column4) Column4_Sum
, (Column2_Sum + Column3_Sum + Column4_Sum) Total_Sum
, Rank (Total_Sum) Total_Sum_Rank
FROM
GROUP BY Name
ORDER BY Total_Sum DESC
Qualify Total_Sum_Rank <= 10
i know this code won't work because you can't + in a select. how can i duplicate the logic?