make select only by the month of a given column - mysql

3

I want to do select with the condition that the column has a given month, and only brings results this month.

I was doing this, but it did not work.

SELECT * from funcionarios where dataEntrada = month(10);

I'm using mysql workbeanch

    
asked by anonymous 13.09.2015 / 03:07

1 answer

7

In order to filter certain records within MySQL, you can do the following:

Filtering records by Day

SELECT * FROM tabela WHERE DAY(data) = 'dia_escolhido'

Filtering records by month

SELECT * FROM tabela WHERE MONTH(data) = 'mes_escolhido'

Filtering records by Year

SELECT * FROM tabela WHERE YEAR(data) = 'ano_escolhido'

Using Day, Month, Year - can filter the data correctly.

    
13.09.2015 / 03:11