문제정리

모서아·2024년 12월 4일

문제정리

목록 보기
3/6

코드카타

Q. 가격이 제일 비싼 식품의 정보 출력하기

A. select *
   from food_product
   order by price desc
   limit 1

limit으로 한 칸만 데리고 오기

A. select product_id,
	        product_name,
          product_cd,
          category,
          price
   from food_product
   where price = (select max(price) from food_product

실행순서때문에 where 절에서 max 함수가 실행이 안 됌 !
실행순서 참고하기

0개의 댓글