조컴퓨터

hackerrank Draw The Triangle 2 본문

HackerRank/SQL

hackerrank Draw The Triangle 2

챠오위 2021. 2. 18. 23:55

 

 

1) SET

 

1-1)

SET @row := 0;

 

 

 

2) * 반복

 

2-1)

REPEAT( "* ", @row := @row + 1 )

 

 

 

3) INFORMATION_SCHEMA.tables

 

3-1)

SET @row :=0;

SELECT REPEAT("* ", @row := @row + 1 )

FROM INFORMATION_SCHEMA.tables

 

 

 

4) where절

 

4-1)

SET @row := 0;

SELECT REPEAT("* ", @row := @row + 1 )

FROM INFORMATION_SCHEMA.tables

WHERE @row < 20;

 

4-1) 결과

 

이하 20줄까지 출력된다.

 

 

SUCCESS!!

 

 

 

 

 

'HackerRank > SQL' 카테고리의 다른 글

hackerrank Weather Observation Station 6  (0) 2021.01.31
hackerrank Weather Observation Station 5  (0) 2021.01.31
hackerrank Weather Observation Station 3  (0) 2021.01.30
hackerrank Symmetric Pairs  (0) 2021.01.18
hackerrank Type of Triangle  (0) 2021.01.18