Get date before 2000 MySql

3

I need to select all employees with a contracted date prior to the year 2000. How can I put this condition in the Where clause?

SELECT nome_funcionario FROM funcionario WHERE data_contratacao...
    
asked by anonymous 01.03.2018 / 00:41

2 answers

5

I would do it differently, using the YEAR() function.

SELECT nome_funcionario FROM funcionario WHERE YEAR(data_contratacao) < 2000
    
01.03.2018 / 00:53
2
SELECT nome_funcionario FROM funcionario WHERE data_contratacao < '2000-01-01'
    
01.03.2018 / 00:46