Giken Dev
article thumbnail
[SQL][ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ๊ณ ๋“์ KIT] SELECT

๋ชจ๋“  ๋ ˆ์ฝ”๋“œ ์กฐํšŒํ•˜๊ธฐ SELECT * FROM ANIMAL_INS ORDER BY ANIMAL_ID; ORDER BY๋Š” ์˜ค๋ฆ„์ฐจ์ˆœ์ด default ๋ž๋‹ˆ๋‹ค. ์˜ค๋ฆ„์ฐจ์ˆœ : ORDER BY attribute ASC; (ASC๋Š” ์ƒ๋žต ๊ฐ€๋Šฅ) ๋‚ด๋ฆผ์ฐจ์ˆœ : ORDER BY attribute DESC; ์—ญ์ˆœ ์ •๋ ฌํ•˜๊ธฐ SELECT NAME, DATETIME FROM ANIMAL_INS ORDER BY ANIMAL_ID DESC; ์—ญ์ˆœ ์ •๋ ฌ (์ฆ‰ ์˜ค๋ฆ„์ฐจ์ˆœ ์ •๋ ฌ์˜ ์—ญ์ˆœ์ด ๋‚ด๋ฆผ์ฐจ์ˆœ ์ •๋ ฌ์ž…๋‹ˆ๋‹ค.) ์•„ํ”ˆ ๋™๋ฌผ ์ฐพ๊ธฐ SELECT ANIMAL_ID, NAME FROM ANIMAL_INS WHERE INTAKE_CONDITION = 'Sick' ORDER BY ANIMAL_ID; WHERE ์กฐ๊ฑด์ ˆ์„ ํ†ตํ•ด์„œ 'sick'ํ•œ tuple์„ ..