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 2
Draw The Triangle 2
Sort by
recency
|
896 Discussions
|
Please Login in order to post a comment
with starpattern as (select 1 as num union all select num + 1 from starpattern where num<20 ) select replicate('* ', num)as stars from starpattern option(maxrecursion 0);
DECLARE @I INT = 1 WHILE @I <= 20 BEGIN PRINT RTRIM(REPLICATE('* ',@I)) SET @I=@I+1 END;
For MySQL
ORACLE SQL select rpad(' ', (l)2, ' ') from (SELECT Level l FROM Dual CONNECT BY Level <= 20);