Sort by

recency

|

1277 Discussions

|

  • + 0 comments

    SELECT LPAD('', 42 - 2 LEVEL, ' *') AS stars FROM dual CONNECT BY LEVEL <= 20;

  • + 0 comments

    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;

  • + 0 comments

    with recursive star(x) as ( select 20 as x union all select x-1 from star where x > 0 ) select repeat('* ', x) from star

  • + 0 comments
    With numbers as (
    
    select 20 as n
    Union all 
    
    select n-1 from numbers where n>1
    )
    
    select REPLICATE('* ',n) as P from numbers
    
  • + 0 comments
    DELIMITER ##
    CREATE PROCEDURE p(IN ic INT)
    BEGIN
        WHILE ic > 0 DO
            SELECT REPEAT('* ', ic);
            SET ic = ic - 1;
        END WHILE;
    END##
    
    DELIMITER ;
    
    -- run procedure for 20:
    CALL p(20);