hraja77
asked on
sql query
Hi,
I have a table which logs all reboots of a till on our system;
I need a query to see on a particular day how many tills rebooted - problem is that some times a till may reboot 3 times in a day and record three records into my table but i only need to show this as one:
my table is called audit: columns are:
id
timestamp
tillname
thanks
H
I have a table which logs all reboots of a till on our system;
I need a query to see on a particular day how many tills rebooted - problem is that some times a till may reboot 3 times in a day and record three records into my table but i only need to show this as one:
my table is called audit: columns are:
id
timestamp
tillname
thanks
H
ASKER
hi,
on one day the till will reboot more than once but i only want to record the fact it rebooted once
thanks
H
on one day the till will reboot more than once but i only want to record the fact it rebooted once
thanks
H
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you show a sample of your required output? The answer that rmandra gave looks OK to me. Do you want to show just the days that have reboots? Then it's just a distinct, something like this:
select distinct(to_char(timestamp ,'mm-dd-yy yy'))
from audit;
select distinct(to_char(timestamp
from audit;
Try to select till_id , max(reboot time) , and count(), Grouping By till_id.
from audit
group by tillname, to_char(timestamp,'mm-dd-y