0

I want inverted triangle using teradata sql. I have written below recursive query and getting the output. But i want to print inverted triangle using stored procedure .

with recursive atr_col(id, val) AS ( sel 1, cast('' as varchar(1000)) as val from (sel 1 as dummy) a union all sel tb2.id+1, trim(tb2.val)||'' from atr_col tb2 where tb2.id<=val) sel val from atr_col order by id desc;

  • What exactly do you mean by *print inverted triangle using stored procedure*? And what are you actually trying to achieve, returning '*'s? – dnoeth Aug 30 '20 at 20:58
  • i want to write a procedure that will print inverted triangle in teradata – VISHAL SINGH Aug 31 '20 at 03:40
  • What does *print* mean, return it as an answer set? You need a dummy cursor, see https://docs.teradata.com/reader/CeAGk~BNtx~axcR0ed~5kw/JvQJaDKG9tlIvn1~6~UsCg – dnoeth Aug 31 '20 at 10:03
  • Sample data and desired results would be really helpful here. – Andrew Aug 31 '20 at 15:33

0 Answers0