I want to do an ordered SQL query for the first 3 months from the current month, for example:
Current month is August (08), so I order as:
10
9
8
1
12
I am using the following command:
SELECT * FROM 'tb_convencao' WHERE 'lg_historico' = 0 ORDER BY ('desc_database') >= MONTH(now()) DESC, ('desc_database') < date_add(MONTH(now()), interval 3 month)
But it is returned to me:
10
12
8
9
1
Any tips?