ji-0630 / CodingTest

코딩테스트 연습 기록
0 stars 0 forks source link

대여 기록이 존재하는 자동차 리스트 구하기 #246

Closed ji-0630 closed 1 year ago

ji-0630 commented 1 year ago

문제 설명

image image

ji-0630 commented 1 year ago

나의 풀이

SELECT distinct c.CAR_ID
from CAR_RENTAL_COMPANY_CAR c left join CAR_RENTAL_COMPANY_RENTAL_HISTORY r
on c.CAR_ID = r.CAR_ID
where c.CAR_TYPE = "세단"
and date_format(r.START_DATE, "%Y-%m") = "2022-10"
order by c.CAR_ID desc