- https://school.programmers.co.kr/learn/courses/30/lessons/157339 With counter AS( SELECT CAR.DAILY_FEE , CAR.CAR_ID , CAR.CAR_TYPE , START_DATE , END_DATE FROM CAR_RENTAL_COMPANY_RENTAL_HISTORY AS HISTORY INNER JOIN CAR_RENTAL_COMPANY_CAR AS CAR ON CAR.CAR_ID = HISTORY.CAR_ID AND CAR.CAR_TYPE IN ('세단', 'SUV') WHERE (START_DATE > '2022-11-30' or END_DATE < '2022-11-01') ) SELECT DISTINCT CAR_ID..