TECH

Higher Than 75 Marks

AKA.DM 2022. 6. 15. 08:24
반응형

Query the Name of any student in STUDENTS who scored higher than  Marks. Order your output by the last three characters of each name. If two or more students both have names ending in the same last three characters (i.e.: Bobby, Robby, etc.), secondary sort them by ascending ID.

Input Format

Sample Output

Ashley
Julia
Belvet

 

내가 다시 생각한 방법

select
    name
from 
    (select 
        substr(name, -3) as sname,
        name
     from
         students
     where
         marks > 75
     order by sname, id);

 

인터넷에 찾아본 방법

select
    name
from 
    students
where
    marks > 75
order by 
    substr(name, -3), id;

 

substr(컬러명, 숫자)

반응형

'TECH' 카테고리의 다른 글

센드타임 VS 되는시간  (2) 2022.07.13
Weather Observation Station 16  (0) 2022.06.20
Weather Observation Station 12  (0) 2022.06.13
Weather Observation Station 11  (0) 2022.06.10
Weather Observation Station 10  (0) 2022.06.10