4
Personal I am facing a doubt with a particular query, I have searched everywhere on the subject but without success. If there’s any other way to do what I’m trying, I’d appreciate the information
So I’ll illustrate the scenario.
VOUCHER TABLE
In this table I am assigning a serial_lot since the vouchers will be generated in large quantities, each voucher has a Total Time_total.
I managed to create a query where returns me all serial_batch that were created in the last 2 hours and the times that this batch repeats.
SELECT serial_lote, Count(*) FROM vouchers
where (data_criacao BETWEEN DATE_SUB(NOW(), INTERVAL 2 hour) AND NOW()) GROUP BY serial_lote
HAVING Count(*) > 1
order by serial_lote DESC
I need you to return not only the serial lot and the amount of times this batch repeats, but also the total Time_total of each batch. (Lots can only be created with the same Total Time)
http://forum.wmonline.com.br/topic/176750-somar-horas-de-campo-typo-time-no-mysql/ should help you
– Motta
I must have confused you, I don’t want to add the total time.. I wonder what is the time of each Lot.
– Michel Teixeira