Re: [SQL] question with times and intervals

2006-01-26 Thread Andreas Kretschmer
Richard Huxton schrieb: > Now (upper_time - lower_time) is the interval you want and summing them > will give you your answer. > > Any help? Yes, thanks. But, i remember a little function that i wrote in the past: http://a-kretschmer.de/tools/time_intersect.sql And now i have a solution (i h

Re: [SQL] question with times and intervals

2006-01-26 Thread Richard Huxton
A. Kretschmer wrote: Hi, I have a table like this: test=# select * from status_log ; id | status |t_start | t_end +++ 1 | 1 | 2006-01-20 23:00:00+01 | 2006-01-21 06:00:00+01 1 | 1 | 2006-01-21 06:

[SQL] question with times and intervals

2006-01-26 Thread A. Kretschmer
Hi, I have a table like this: test=# select * from status_log ; id | status |t_start | t_end +++ 1 | 1 | 2006-01-20 23:00:00+01 | 2006-01-21 06:00:00+01 1 | 1 | 2006-01-21 06:00:00+01 | 2006-01-21 2