Red Glitter Pointer

 

 

 

SELECT name
FROM students
WHERE marks > 75
ORDER BY RIGHT(name, 3), id

 

 

느낀 점 및 정리 ✍️

1. "Order your output by the last three characters of each name" => RIGHT(name, 3) 을 사용해서 이름의 가장 오른쪽에 있는 문자 3개를 추출하여 정렬했다.

2. "names ending in the same last three characters, secondary sort them by ascending ID" => 문자 3가지가 동일할 경우 id 오름차순 정렬

 

 

 

 

+ Recent posts

loading