I have this Select below:
SELECT b.id,
b.codigo,
a.codacesso,
a.seqproduto,
a.desccompleta,
b.quantidade,
b.data_vencimento,
b.data_atual,
b.observacao,
b.usuario,
b.estado,
b.loja,
a.medvdiageral,
a.comprador,
a.preco
FROM master_datas_b a, master_coletores b
WHERE b.tipo_acao IS NULL
and a.comprador = :comprador
and a.nroempresa = :loja
and b.loja = :loja
and estado = 'Ativo'
and b.codigo = a.codacesso
AND b.data_vencimento BETWEEN TO_DATE(:data1, 'YYYY-MM-DD') AND
TO_DATE(:data2, 'YYYY-MM-DD')
and b.quantidade > 0
ORDER BY b.data_vencimento, b.codigo ASC
It is returning the values but not the way I need it, it is sorting by day, for example:
12/11/2018
13/12/2018
14/11/2018
I need to make the order by day and month and December appear only at the bottom of the list ..