Timeseries with crossjoin

Moderator: NorbertKrupa

Post Reply
rekha1111
Newbie
Newbie
Posts: 1
Joined: Wed May 31, 2017 5:58 pm

Timeseries with crossjoin

Post by rekha1111 » Wed May 31, 2017 6:01 pm

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

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1768
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Timeseries with crossjoin

Post by JimKnicely » Wed May 31, 2017 8:31 pm

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)
Jim Knicely

Image

Note: I work for HPE. My views, opinions, and thoughts expressed here do not represent those of my employer.

Post Reply

Return to “New to Vertica”