I want to get data from training_course table where current date minus 5 days is equal to training_end_date. Training_end_date is my field in the table. Thanks
Advertisement
Answer
You seem to want:
x
select *
from training_course
where training_end_date = current_date - interval 5 day
Or, if your dates have time components, you maybe want:
select *
from training_course
where training_end_date >= current_date - interval 5 day and training_date < current_date - interval 4 day