Hallo: I did some text processing of the database using Shell and Python. For interaction, I am going to do this using SQL. SQL is suitable for some query tasks. But I'm not sure if SQL can handle all my tasks. Consider an example database:
item | time | value
----- + ------ + -------
1 | 134 | 3
2 | 304 | 1
3 | 366 | 2
4 | 388 | 2
5 | 799 | 6
6 | 111 | 7
I need to profile the sum of # values ββfor a specific time interval #time. Suppose that the time interval is 100 , the result should be:
time_interval | sumvalue
-------------- + ----------
1 | 10 - the time interval from 100 to 199
3 | 5 - the time interval from 300 to 399
7 | 6 - the time interval from 700 to 799 I could not find a better way to do this from a SQL tutorial than doing this with a shell and python.
So my friends, any suggestion?
Thanks!
source share