Page 1 of 1

Timeseries with crossjoin

Posted: Wed May 31, 2017 6:01 pm
by rekha1111
Hi

I am trying to generate a time series with cross join .. here is my sql

SELECT
time_slice

FROM
table1
CROSS JOIN
table2

TIMESERIES time_slice AS '1 hour' over(ORDER BY date_to_process)

this does not work .. is there anything wrong with sql

Thanks

Re: Timeseries with crossjoin

Posted: Wed May 31, 2017 8:31 pm
by JimKnicely
Hi,

It should work ok. What specific error do you get?

Although I have no data, the following is syntactically correct:

dbadmin=> create table table1(date_to_process timestamp);
CREATE TABLE

dbadmin=> create table table2(col1 int);
CREATE TABLE

dbadmin=> select slice_time from table2 cross join table1 timeseries slice_time as '1 hour' over (order by date_to_process);
slice_time
------------
(0 rows)