I have a table where I store sales. Home
There was a need to order sellers by the amount of sales.
In case of a tie the one who made the most recent sale gets first.
I can bring with the sql below, the seller and time of the sale, however I would like to already bring the sales sum of each seller and tie case already ordered by the time of the sale.
SELECT v.vendedor, v.data_venda , v.hora_venda
FROM vendas v
ORDER BY v.data_venda desc, v.hora_venda desc
Any ideas?