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
|
1306 Discussions
|
Please Login in order to post a comment
*Counting down from 20: * WITH RECURSIVE counter AS ( SELECT 20 as n UNION ALL SELECT n - 1 FROM counter WHERE n > 1 ) SELECT REPEAT('* ', n) FROM counter;
MY SQL SET @row := 6;
SELECT REPEAT('* ', @row := @row - 1) FROM information_schema.tables LIMIT 5;
My Sql:
WITH RECURSIVE triangle(NUMBER) as (SELECT 1 AS NUMBER
UNION ALL
SELECT NUMBER+1 FROM triangle WHERE NUMBER < 20 )
SELECT REPEAT('* ',NUMBER) FROM triangle ORDER BY NUMBER DESC;
with RECURSIVE cte as( select 20 as nm union all select nm-1 from cte where nm>1 ) SELECT repeat( '* ',nm) from cte
select "* * * * * * * * * * * * * * * * * * * *"; select " * * * * * * * * * * * * * * * * * * *"; select " * * * * * * * * * * * * * * * * * *"; select " * * * * * * * * * * * * * * * * *"; select " * * * * * * * * * * * * * * * *"; select " * * * * * * * * * * * * * * *"; select " * * * * * * * * * * * * * *"; select " * * * * * * * * * * * * *"; select " * * * * * * * * * * * *"; select " * * * * * * * * * * *"; select " * * * * * * * * * *"; select " * * * * * * * * *"; select " * * * * * * * *"; select " * * * * * * *"; select " * * * * * *"; select " * * * * *"; select " * * * *"; select " * * *"; select " * "; select "";