https://programmers.co.kr/learn/courses/30/lessons/59405
Oracle์์ ์์ n๊ฐ ๋ ์ฝ๋๋ง ๊ฐ์ ธ์ค๋ ์ฟผ๋ฆฌ๊ฐ ์๊ฐ์ด ๋์ง ์์๋ค. FROM ์์ ์๋ธ์ฟผ๋ฆฌ๋ฅผ ์จ์ผ ํ์๋ค..
Oracle์ด ์ต์ํ๊ธด ํ๋ฐ, MySQL์ด ๋ ๊ฐ๋จํด๋ณด์ธ๋ค.
Oracle
WHERE rownum = n
SELECT NAME
FROM (SELECT * FROM ANIMAL_INS ORDER BY DATETIME)
WHERE rownum = 1
MySQL
LIMIT n
SELECT NAME
FROM ANIMAL_INS
ORDER BY DATETIME
LIMIT 1
'DB > SQL' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
SQL - ์ฐ์ฐ์ IN (0) | 2022.06.17 |
---|---|
SQL - JOIN (0) | 2022.06.14 |
SQL - NVL() (0) | 2022.06.14 |
SQL - HAVING (0) | 2022.06.13 |
SQL - ์ง๊ณ ํจ์ (0) | 2022.06.13 |