We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Draw The Triangle 1
Draw The Triangle 1
Sort by
recency
|
1206 Discussions
|
Please Login in order to post a comment
My solution SQL SERVER:
Declare @Count Tinyint = '20' WHILE @Count >= 1 begin print replicate('* ',@Count) Set @Count = @Count-1 end;
dont forget the space guys "* "
Oracle: WITH T1 AS ( SELECT LEVEL lvl FROM DUAL CONNECT BY LEVEL <= 20 ORDER BY LEVEL DESC ) SELECT RPAD('* ', lvl*2, '* ') FROM T1;
FOR SQL SERVER with starpattern as ( select 20 as num union all select num -1 from starpattern where num>1 ) select replicate('* ',num)as stars from starpattern option(maxrecursion 0);
For MySQL