I need to make a select that brings me instances that the start date of a license is less than 3 years from an employee's date of admission
Below is an excerpt from my code.
SELECT *
FROM
jmh_licenca l
INNER JOIN
jmh_servidor s on l.lic_ser_id = s.ser_id
INNER JOIN
jmh_doenca d ON l.doe_id = d.doe_id
WHERE
l.lic_data_inicial BETWEEN '2012-08-01' AND '2015-08-01' AND
l.lic_data_inicial **< (3anos)** s.ser_data_admissao AND
tip_lic_id in ('9', '12');