
select name
from students
where marks > 75
order by substr(name,-3) asc, id asc
SUBSTR(string, start_position, length)
โข start_position: ์์ ์์น (1๋ถํฐ ์์, ์์์ด๋ฉด ๋ค์์๋ถํฐ)
โข length: ๋ช ๊ธ์๋ฅผ ๊ฐ์ ธ์ฌ์ง (์์์ด๋ฉด ์ผ๋ถ DBMS์์ ์ค๋ฅ)
๐จ error
substr(name,-1,-3)
-1 ~ -3 ๊น์ง ๋ฌธ์๋ฅผ ๊ฐ์ ธ์ฌ๊ฑฐ๋ผ๊ณ ์๊ฐํ๋๋ฐ, ๊ธธ์ด์ ์์๋ฅผ ๋ฃ์ ์ ์๋ค๊ณ ํ๋ค.
์ค๋ฅธ์ชฝ ๋ฐฉํฅ์ผ๋ก ๋ฌธ์์ด ์๋ฅธ๋ค๊ณ ๋ง ์๊ฐํด์ผ๊ฒ ๋ค.