문제
MYSQL
내가 작성한 정답
SELECT distinct c.car_id
from CAR_RENTAL_COMPANY_CAR c
join CAR_RENTAL_COMPANY_RENTAL_HISTORY h on c.car_id = h.car_id
where c.car_type = '세단' and month(h.start_date) = 10
order by 1 desc
SELECT c.car_id
from car_rental_company_car c
join car_rental_company_rental_history h on c.car_id = h.car_id
where c.car_type = '세단' and month(h.start_date) = 10
group by c.car_id
order by 1 desc
ORACLE
내가 작성한 정답
SELECT distinct c.car_id
from CAR_RENTAL_COMPANY_CAR c
join CAR_RENTAL_COMPANY_RENTAL_HISTORY h on c.car_id = h.car_id
where c.car_type = '세단' and to_char(h.start_date,'mm') = '10'
order by car_id desc
Share article