• [deleted]
    + 0 comments

    For MySQL

    DELIMITER $$
    
    CREATE PROCEDURE printPattern()
    BEGIN
        DECLARE i INT DEFAULT 20;
        
        WHILE i>0 DO
            SELECT IF(i=1, "*", REPEAT("* ", i));
            SET i = i-1;
        END WHILE;
    END$$
    
    DELIMITER ;
    
    CALL printPattern();