Modify database query appropriately 86/233686/1
authorhyunuk.tak <hyunuk.tak@samsung.com>
Mon, 18 May 2020 07:57:23 +0000 (16:57 +0900)
committerhyunuk.tak <hyunuk.tak@samsung.com>
Mon, 18 May 2020 07:57:25 +0000 (16:57 +0900)
Change-Id: I45bc4f031cd65252d85fd5de9bba6e3eee00b24c
Signed-off-by: hyunuk.tak <hyunuk.tak@samsung.com>
src/database/tables/table-statistics.c

index b631d47..2bfff70 100755 (executable)
 
 #define SELECT_CHUNKS_APP "select iftype, hw_net_protocol_type, " \
        "is_roaming, sum(received) as received, sum(sent) as sent, " \
-       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as time_stamp " \
+       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as timestamp " \
        "from statistics " \
-       "group by iftype, ifname, time_stamp, hw_net_protocol_type, is_roaming  " \
-       "order by time_stamp, iftype, ifname, hw_net_protocol_type, is_roaming"
+       "group by iftype, ifname, timestamp, hw_net_protocol_type, is_roaming  " \
+       "order by timestamp, iftype, ifname, hw_net_protocol_type, is_roaming"
 
 #define SELECT_CHUNKS_APP_IFACE "select iftype, hw_net_protocol_type, " \
        "is_roaming, sum(received) as received, sum(sent) as sent, " \
-       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as time_stamp " \
+       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as timestamp " \
        "from statistics where time_stamp between ? and ? and binpath = ? " \
        "and iftype = ? " \
-       "group by time_stamp, hw_net_protocol_type, is_roaming, " \
+       "group by timestamp, hw_net_protocol_type, is_roaming, " \
        "iftype, ifname, subscriber_id " \
-       "order by time_stamp, iftype, ifname, subscriber_id, hw_net_protocol_type, " \
+       "order by timestamp, iftype, ifname, subscriber_id, hw_net_protocol_type, " \
        "is_roaming"
 
 #define SELECT_TOTAL "select iftype, hw_net_protocol_type, " \
 
 #define SELECT_CHUNKS_TOTAL "select iftype, hw_net_protocol_type, " \
        "is_roaming, sum(received) as received, sum(sent) as sent, " \
-       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as time_stamp " \
+       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as timestamp " \
        "from statistics where time_stamp between ? and ? " \
        "and binpath NOT LIKE 'TOTAL_%' " \
-       "group by time_stamp, iftype, ifname, subscriber_id, hw_net_protocol_type, " \
+       "group by timestamp, iftype, ifname, subscriber_id, hw_net_protocol_type, " \
        "is_roaming " \
-       "order by time_stamp, iftype, ifname, subscriber_id, hw_net_protocol_type, " \
+       "order by timestamp, iftype, ifname, subscriber_id, hw_net_protocol_type, " \
        "is_roaming"
 
 #define SELECT_CHUNKS_TOTAL_IFACE "select iftype, hw_net_protocol_type, " \
        "is_roaming, sum(received) as received, sum(sent) as sent, " \
-       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as time_stamp " \
+       "ifname, subscriber_id, ground, time_stamp - time_stamp % ? as timestamp " \
        "from statistics where time_stamp between ? and ? " \
        "and iftype = ? " \
        "and binpath NOT LIKE 'TOTAL_%' " \
-       "group by time_stamp, hw_net_protocol_type, is_roaming, iftype, ifname, subscriber_id " \
-       "order by time_stamp, hw_net_protocol_type, is_roaming, iftype, " \
+       "group by timestamp, hw_net_protocol_type, is_roaming, iftype, ifname, subscriber_id " \
+       "order by timestamp, hw_net_protocol_type, is_roaming, iftype, " \
        "ifname, subscriber_id"
 
 /* INSERT statement */