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
|
1277 Discussions
|
Please Login in order to post a comment
SELECT LPAD('', 42 - 2 LEVEL, ' *') AS stars FROM dual CONNECT BY LEVEL <= 20;
what is wrong in this ??
WITH RECURSIVE cte AS ( SELECT 1 AS n, '' AS stars UNION ALL SELECT n + 1, CONCAT(stars, '') FROM cte WHERE n < 6 ) SELECT stars FROM cte ORDER BY stars DESC;
with recursive star(x) as ( select 20 as x union all select x-1 from star where x > 0 ) select repeat('* ', x) from star