0
I have single table called flow, which has every 10 mins flow sample. I want to show sum of this samples per shift like 8am to 4pm shift1, 4pm to 12am shift2, 12am to 8am shift3
how to collect data like date shit1 shift2 shift3 1.4.15. 35. 39. 65 2.4.15 likewise
2 ответов
0
Normalise the tables. Include 'shift_id 'column in your flow table.
create another table named "Shift" which should contain columns (Shif , start_time, end_time).
e.g : Shift Table
shift_id | start_time | end_time |
Shift 1 | 8am | 4pm |
Shift 2 | 4am | 12pm |
Shift 3 | 12am | 8am |
Query :
select sum(sample) from flow
group by shift_id;
OR
select sum(f.sample), s.start_time, s.end_time
from flow f JOIN shift s
ON(f.shift_id=s.shift_id)
group by f.shift_id;
0
pls help me how to use flowchart