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
|
1233 Discussions
|
Please Login in order to post a comment
WITH RECURSIVE Pattern AS ( SELECT 20 AS num UNION ALL SELECT num - 1 FROM Pattern WHERE num > 1 ) SELECT REPEAT('* ', num) FROM Pattern;
Use MySql :-
WITH RECURSIVE Pattern AS ( SELECT 20 AS row_num UNION ALL SELECT row_num - 1 FROM Pattern WHERE row_num > 1 ) SELECT REPEAT('* ', row_num) AS pattern_row FROM Pattern;
You can try this one... (-:)
Use of sqlserver 2022 features:
SELECT REPLICATE('* ', value) FROM GENERATE_SERIES(20, 1)
DELIMITER $
CREATE PROCEDURE triangulo()
BEGIN
END$
CALL triangulo() `
with recursive num_ct as (select 20 as num union all select num-1 from num_ct where num>1) select trim(repeat('*',num)) as apt from num_ct order by num desc;
why is this not working? it gives the correct output tho..