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
|
883 Discussions
|
Please Login in order to post a comment
SET SERVEROUTPUT ON; BEGIN FOR i IN 1..20 LOOP DBMS_OUTPUT.PUT_LINE(RPAD('* ', 2*i, '* ')); END LOOP; END; /
with recursive tmp as ( select 1 as num union all select num + 1 from tmp limit 20) select repeat('* ', num) from tmp;
MySQL-
SET @row = 0;
SELECT REPEAT('* ', @row := @row + 1) AS pattern FROM information_schema.tables LIMIT 20;
SET SERVEROUTPUT ON; DECLARE v_var NUMBER := 0; BEGIN -----block WHILE v_var <= 20 LOOP DBMS_OUTPUT.PUT_LINE(LPAD('* ', v_var * 2, '* ')); ---print v_var := v_var + 1; END LOOP; END; /