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
|
906 Discussions
|
Please Login in order to post a comment
MYSQL
WITH RECURSIVE Pattern AS ( SELECT 1 AS num UNION ALL SELECT num + 1 FROM Pattern WHERE num < 20 ) SELECT REPEAT('* ', num) FROM Pattern;
DECLARE @counter INT = 1;
WHILE @counter <=20
BEGIN
PRINT REPLICATE('* ', @counter);
SET @counter = @counter + 1
END
WITH RECURSIVE pattern AS ( SELECT 1 AS row_num UNION ALL SELECT row_num + 1 FROM pattern WHERE row_num < 20 ) SELECT REPEAT('* ', row_num) AS stars FROM pattern;