Re: [SQL] TPCH Benchmark query result invalid

2006-12-12 Thread Cronje Fourie
Thanks guys. Richard your fix didn't seem to work. But it's got me in the right direction :) Time to RTFM ;) Cronje On Tue, 2006-12-12 at 15:05 +, Richard Huxton wrote: > Cronje Fourie wrote: > > When running the following query against a TPCH db I get 0 results > > returned > > > and

Re: [SQL] TPCH Benchmark query result invalid

2006-12-12 Thread Michael Glaesemann
On Dec 13, 2006, at 1:23 , Tom Lane wrote: Richard Huxton writes: richardh=# SELECT interval '3' month; interval -- 00:00:00 (1 row) It's got a zero-length date-range it's comparing against. If you have interval '3 months' that should work, but I'm afraid I haven't got time

Re: [SQL] Finding gaps in scheduled events

2006-12-12 Thread Erik Jones
Alvaro Herrera wrote: Marcin Stępnicki wrote: Now I need to create a query to find hours at which each of the type can start. So, if it's event A (which take 15 minutes) it can start at: 8:00 (to 8:15) 8:15 (to 8:30) ( 8:30 to 8:45 is already taken ) 8:45 (to 9:00) 9:00 (to 9:15) 9:15 (to 9

Re: [SQL] Finding gaps in scheduled events

2006-12-12 Thread Alvaro Herrera
Marcin Stępnicki wrote: > Now I need to create a query to find hours at which each of the type can > start. So, if it's event A (which take 15 minutes) it can start at: > > 8:00 (to 8:15) > 8:15 (to 8:30) > ( 8:30 to 8:45 is already taken ) > 8:45 (to 9:00) > 9:00 (to 9:15) > 9:15 (to 9:30) > ( 9

Re: [SQL] Finding gaps in scheduled events

2006-12-12 Thread Erik Jones
Richard Huxton wrote: Marcin Stępnicki wrote: start | finish | type_id --++ 8:30 | 8:45 |1-> type A 9:30 | 10:00 |2-> type B I have to deal with the existing schema, but if it can be done in a better way please let me know so I could avoid mistakes in

Re: [SQL] Finding gaps in scheduled events

2006-12-12 Thread Richard Huxton
Marcin Stępnicki wrote: start | finish | type_id --++ 8:30 | 8:45 |1-> type A 9:30 | 10:00 |2-> type B I have to deal with the existing schema, but if it can be done in a better way please let me know so I could avoid mistakes in my own programs (altho

[SQL] Finding gaps in scheduled events

2006-12-12 Thread Marcin Stępnicki
Hello. I've been struggling with this one for over a week, but for some reason my mind isn't compatibile with the problem - it seems simple, yet I'm unable to find the proper solution :(. I have a timeline divided to 15 minute periods: start | --+ 8:00 | 8:15 | 8:30 | 8:45 | (...)| 14

Re: [SQL] TPCH Benchmark query result invalid

2006-12-12 Thread Tom Lane
Richard Huxton writes: > richardh=# SELECT interval '3' month; > interval > -- > 00:00:00 > (1 row) > It's got a zero-length date-range it's comparing against. If you have > interval '3 months' that should work, but I'm afraid I haven't got time > to check against the specs to see

Re: [SQL] TPCH Benchmark query result invalid

2006-12-12 Thread Richard Huxton
Cronje Fourie wrote: When running the following query against a TPCH db I get 0 results returned and o_orderdate < date '1993-07-01' + interval '3' month That's the problem line. richardh=# SELECT interval '3' month; interval -- 00:00:00 (1 row) It's got a zero-length da

[SQL] TPCH Benchmark query result invalid

2006-12-12 Thread Cronje Fourie
When running the following query against a TPCH db I get 0 results returned select o_orderpriority, count(*) as order_count from orders where o_orderdate >= date '1993-07-01' and o_orderdate < date '1993-07-01' + interval '3' month and exists (