Notice
Recent Posts
Recent Comments
Link
«   2024/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags more
Archives
Today
Total
관리 메뉴

요리사에서 IT개발자로

가격이 제일 비싼 식품의 정보 출력하기(MySQL) 본문

Code Kata

가격이 제일 비싼 식품의 정보 출력하기(MySQL)

H.S-Backend 2024. 5. 11. 11:16

문제

FOOD_PRODUCT 테이블에서

가격이 제일 비싼 식품의 식품 ID, 식품 이름, 식품 코드, 식품분류, 식품 가격을 조회하는 SQL문을 작성해주세요.

 

해결

ORDER BY절 사용

가격 = PRICE

제일 비싸다 = 높다

DESC  내림차순 정렬 하여 

LIMIT 1;제일 높은 것만 보이게

 

ORDER BY PRICE DESC LIMIT 1;

 

https://github.com/Hyungs0703/Algorithms_J.S

 

GitHub - Hyungs0703/Algorithms_J.S: This is an auto push repository for Baekjoon Online Judge created with [BaekjoonHub](https:/

This is an auto push repository for Baekjoon Online Judge created with [BaekjoonHub](https://github.com/BaekjoonHub/BaekjoonHub). - Hyungs0703/Algorithms_J.S

github.com

 

반응형