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
|
823 Discussions
|
Please Login in order to post a comment
with recursive cnt(val) as ( select 1 as val union select val +1 from cnt where val < 20 ) select REPEAT('* ', val) from cnt;
WITH Numbers AS ( SELECT 1 AS n UNION ALL SELECT n + 1 FROM Numbers WHERE n < 20 ) SELECT TOP 20 REPLICATE(" *", n) FROM Numbers;
For MSSQL
MYSQL:WITH RECURSIVE pattern AS ( SELECT 1 AS level UNION ALL SELECT level + 1 FROM pattern WHERE level < 20 ) SELECT REPEAT('* ', level) AS stars FROM pattern;