Monday, 25 March 2019

Draw The Triangle 2 HackerRank SQL Solution

Problem:-

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).

Solution:-

set @row := 0;

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

No comments:

Post a Comment

Error While embed the video in Your website page

Error:- Refused to display '<URL>' in a frame because it set 'X-Frame-Options' to 'sameorigin Solution:- if ...