My database consists of 2 tables. Im using MySQL.
Table 1
cars = id(int,PRIMARYKEY), reg(int), type(int)
Table 2
jobs = ref(int,PRIMARYKEY), id (int), date(date)
I need a SELECT statement which would get me all the cars which have not had a job in the past 3 weeks.
(i.e: If a car has not had a job in the past 3 weeks, then that car(id) would be returned.)
I know there would be several ways to do this however I am not up to speed in sql yet :<
This is a good use case for
NOT EXISTS: