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
|
961 Discussions
|
Please Login in order to post a comment
WITH stars (lvl, line) AS ( SELECT 1, '*' FROM dual UNION ALL SELECT lvl + 1, line || ' *' FROM stars WHERE lvl < 20 ) SELECT line FROM stars;
SELECT ( SELECT LISTAGG('*', ' ') WITHIN GROUP (ORDER BY LEVEL) FROM dual CONNECT BY LEVEL <= outer_query.numt ) AS star_line FROM ( SELECT LEVEL AS numt FROM dual CONNECT BY LEVEL <= 5 ) outer_query;
WITH RECURSIVE Pattern AS( Select 1 as Level UNION ALL Select level + 1 From Pattern where level < 20 ) Select REPEAT('* ',level) as pattern from Pattern;
in SQL server: