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
Timeseries with crossjoin
Moderator: NorbertKrupa
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: Timeseries with crossjoin
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)
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
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.