Hello. I'd like some help here.
I need to get the records:
MySQL Database
1) last month 2) last 2) 3) Current year
SELECT id, data, lote, modelo, qtd FROM controle_diario WHERE modelo like ?
The table is very simple: id is auto-increment, batch is varchar, template is varchar, and qtd is int. Example:
id - data - modelo - qtd
1 - 2017-04-20 - 10001 - 100
2 - 2017-04-22 - 10002 - 10
3 - 2017-05-10 - 100010 - 30
4 - 2017-05-15 - 100020 - 60
5 - 2017-05-16 - 100060 - 70
6 - 2017-05-20 - 100010 - 100
Thank you