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
|
1191 Discussions
|
Please Login in order to post a comment
Orcale:
I have written a query in PL/SQL for pattern
SELECT LPAD('* ', 40 - 2*LEVEL + 2, '* ') || CHR(32) AS pattern FROM dual CONNECT BY LEVEL <= 20;
with RECURSIVE numbers as ( select 20 as n union all select n-1 from numbers where n > 1 )
select REPEAT('*',n) as stars from numbers
WITH RECURSIVE Stars AS (SELECT 20 AS S UNION ALL SELECT S-1 FROM Stars WHERE S >1) SELECT REPEAT('* ',S) FROM Stars;