Davin Martyn

Davin Martyn

  • NA
  • 8.7k
  • 3m

Print Pyramid in sqlserver

May 10 2017 12:42 PM
Hi Team,
 
I want to print  infinte number pyramid in sqlserver like
ab
abab
ababab
ababab
and after print i want to reverse like
ba
baba
bababa
babababa using CTE.
 
 Please suggest how can do this.
 
 
 My Second Question :
 
Hi Team,
I have one table and inside table two columns id , value
id value
1 a
1 b
1 c
1 d
2 a
2 b
I want to ouput like
id Value
1 a,b,c,d
2 a,b
please write query for above question.
 
 
 

Answers (5)