Hi All,
I have the following table(dailyDataTable) as defined below
          startTime INTEGER : number of minutes in GMT time
          appId INTEGER  : application Id
          remoteId  INTEGER : server id
          proxyCount INTEGER 
This table can have up to 24 hours as below: (this table can have only few rows 
but it can have up to 24 hours).
 startTime       appId   remoteId          proxyCount 
20657220        1        2                     101                            
-- this is 2009-04-11 00:00:00
20657280        1        2                      105                           
-- this is 2009-04-11 01:00:00|
.......................................................................
20658540        1        2                       101                            
   -- this is 2009-04-11 22:00:00
20658600       1        2                       105                             
  -- this is 2009-04-11  23:00:00
 
I need to take these data and insert into another table(weeklyDataTable) with 
the following sql statement:
1) login to weeklyDB
2) Run the following sql statement 
ATTACH DATABASE 'dailyDB'  as DailyDB; insert into weeklyDataTable select 
(strftime('%s',date(startTime * 60,'unixepoch')))/60 , appId, remoteId, 
sum(proxyCount ) from DailyDB.dailyDataTable group by appId, remoteId ; DETACH 
DATABASE DailyDB; "
 
Result below in weeklyDataTable
 20656800   1        2        2386|               -- this 2009-04-10  17:00:00
But this is wrong I want to have this row below in the weeklyDataTable as below.
20657220   1        2        2386|               -- this 2009-04-11 00:00:00
 
Basically I want to have one row in the weeklyDataTable which have the 00:00:00 
for hourly part.
Please help. Your help is greatly appreciate.
Thanks in advance,
JP


      
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to