https://www.hackerrank.com/challenges/more-than-75-marks/problem?isFullScreen=true
SELECT name
FROM students
WHERE marks > 75
ORDER BY RIGHT(name, 3), id
SQL 내 문자열 자르기 함수
LEFT(col_name or str, 길이)
RIGHT(col_name or str, 길이)
SUBSTR(col_name or str, 시작위치, 길이)
ex) 20001109
LEFT(20001109, 4) -> 2000
RIGHT(20001109, 4) -> 1109
SUBSTR(20001109,1,4) -> 2000
SUBSTR(20201109,3) -> 001109 (길이가 정해지지 않으면 끝까지 가져옴)
'SQL' 카테고리의 다른 글
HackerRank_SQL_Type of Triangle <못품> (0) | 2023.01.11 |
---|---|
HackerRank_SQL_Top Eearners (0) | 2023.01.11 |
HackerRank_SQL_Weather Observation Station 15, 소숫점 (0) | 2023.01.05 |
HackerRank_SQL_Weather Observation Station 12 (0) | 2023.01.05 |
HackerRank_SQL_Weather Observation Station 6 (0) | 2023.01.05 |