compare dates within the sql query

2

I need to compare the date entered in the bank +10 days with the current date and display the student that the current date is greater than the 10 days, but this within the sql query. Is there any function for this? I tried this, without success.

$dataMais10 = date('Y-m-d', strtotime('-10 days'));
SELECT aluno,title,dt_banco FROM liberar WHERE dt_banco < {$dataMais10}

OBS. I can not retrieve the dt_bank before the query.

    
asked by anonymous 14.11.2018 / 14:29

1 answer

1

Will it be something like this?

SELECT  aluno,title
    ,   dt_banco 
FROM    liberar 
WHERE   DATE_ADD(dt_banco, INTERVAL 10 DAY) < CURDATE()

Basically the query is fetching all records from the liberar table where the value of the dt_banco + 10 days column is less than the current date.

    
14.11.2018 / 15:22