Add days in mysql using column value

0

I have two tables: person (with email and name) and person_line_online (with a course start date and another with valid days).

Well, I want to filter people with the expired date, so I did the following SQL:

SELECT now() as agora, p.nome, p.email
FROM pessoa p, pessoa_curso_online pco 
WHERE data_add(pco.data_insert, INTERVAL pco.validade day) <= agora 
AND p.id = pco.id_pessoa

However, it is said that my syntax is incorrect, can anyone help me?

    
asked by anonymous 07.03.2018 / 15:42

0 answers