SQL문 연습 with 프로그래머스 (2) (MySQL)
SUM(), AVG(), ROUND(), TRUNCATE() SELECT ROUND(AVG(DAILY_FEE),0) AS AVERAGE_FEE FROM CAR_RENTAL_COMPANY_CAR WHERE CAR_TYPE = 'SUV' AVG() : 평균 SUM() : 합 ROUND( , ) : 반올림 TRUNCATE() : 내림 DATEDIFF() DATEDIFF(날짜1, 날짜2) : 날짜1 - 날짜2 SELECT HISTORY_ID, CAR_ID, DATE_FORMAT(START_DATE, '%Y-%m-%d') AS START_DATE, DATE_FORMAT(END_DATE, '%Y-%m-%d') AS END_DATE, IF(DATEDIFF(END_DATE, ..
2023. 2. 11.