MySQL Forums
Forum List  »  General

grouping of second by second records
Posted by: Roberto B.
Date: April 27, 2014 02:09PM

I have a single table which represent receipts of many days by different cashiers potentially second by second.
Each record has a field with cashier (cashier1,cashier2 ...), a date field and a time file separated, a receipt. Something like:

CASHIER, DATE, TIME, RECEIPT

The cashiers work from 9am o'clock to 7pm o'clock.
I have to analyze them for each cashier and different timeframes (example: 5 minutes, 15 minutes, 30 minutes, 1 hour) putting NULL if any receipt in that timeframe and not consider the time outside 9am -7pm and ordering all by time. To obtain a table like

CASHIER
DATE
START OF TIMEFRAME
END OF TIMEFRAME
MAX RECEIPT OF THAT TIMEFRAME
MIN RECEIPT OF THAT TIMEFRAME
FIRST RECEIPT OF THAT TIMEFRAME
LAST RECEIPT OF THAT TIMEFRAME
SUM OF RECEIPTS OF THAT TIMEFRAME

How can i solve that select in order to have one where i can change just the timeframe?
Thanks in advance

Options: ReplyQuote


Subject
Written By
Posted
grouping of second by second records
April 27, 2014 02:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.