https://www.hackerrank.com/challenges/draw-the-triangle-1/problem?isFullScreen=true
P(R) represents a pattern drawn by Julia in R rows. The following pattern represents P(5):
* * * * *
* * * *
* * *
* *
*
Write a query to print the pattern P(20).
set @number = 21;
SELECT repeat('* ', @number := @number - 1)
FROM information_schema.tables
P(R) represents a pattern drawn by Julia in R rows. The following pattern represents P(5):
*
* *
* * *
* * * *
* * * * *
Write a query to print the pattern P(20).
/*
Enter your query here.
*/
set @number = 0;
SELECT repeat('* ', @number := @number + 1)
FROM information_schema.tables
WHERE @number < 20