Sort by

recency

|

878 Discussions

|

  • + 0 comments

    /MySQL/

    DELIMITER // CREATE PROCEDURE PrintPattern(IN R INT) BEGIN declare val INT default 1; while val <= R DO select repeat('* ', val); set val = val + 1; END WHILE; END // DELIMITER ;

    call PrintPattern(20);

  • + 0 comments

    declare @pointer int = 20, @counter int = 1

    while (@counter <= @pointer) begin select(replicate('* ', @counter)) set @counter = @counter+1 end

  • + 0 comments

    set @row := 0; select repeat('* ', @row := @row + 1) from information_schema.tables where @row < 20

  • + 0 comments
    DECLARE @r INT = 1;
    WHILE @r <= 20 
    BEGIN PRINT REPLICATE('* ', @r)
    SET @r = @r + 1
    END;
    
  • + 0 comments

    MySQL Query

    DELIMITER //
    CREATE PROCEDURE PrintPattern()
    BEGIN
        declare val INT default 1;
        while val < 21 DO
           select repeat('* ', val);
           set val = val + 1;
        END WHILE; 
    END //
    DELIMITER ;
    
    call PrintPattern();