Order_number         T_Calc_Time

2013040100086600 09:16:34

2013040100146880 09:19:13

2013040100406920 09:35:30

2013040100893120 10:13:09

2013040100086600 10:15:14

2013040101906200 12:07:59

2013040100146880 14:48:22

2013040103401460 15:06:34

2013040103407980 15:07:16

2013040103401460 15:09:11

2013040103407980 15:24:22

select Order_number, count(Order_number),T_Calc_Time,TIME_TO_SEC(TIMEDIFF(T_Calc_Time,T_Calc_Time)) from cash_order01 group by Order_number into outfile '/tmp/ordernumber1.csv';

I have to find out that I the order number come again then i have to calculate the difference between those times.

for example the order 2013040100086600 come at 09:16:34 and leave at 10:15:14 i have find the difference and print  for each order. If the order comes only once then we have say it is gone to next day.

can any one help me?

More Bharathi Raja A's questions See All
Similar questions and discussions