Algorithm
Problem Name: Sql -
In this HackerRank Functions in SQL problem solution,
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).
Code Examples
#1 Code Example with MySQL
Code -
MySQL
SET @TEMP:=21;
SELECT REPEAT('* ', @TEMP:= @TEMP - 1)
FROM INFORMATION_SCHEMA.TABLES;
Copy The Code &
Try With Live Editor