Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ERROR: JOIN/USING types bigint and timestamp without time zone cannot be matched
- SELECT
- t.high,
- t.low
- FROM
- (
- SELECT generate_series(
- date_trunc('second', min(ticktime)) ,
- date_trunc('second', max(ticktime)) ,
- interval '1 sec'
- ) FROM czces AS g (time)
- LEFT JOIN
- (
- SELECT
- date_trunc('second', ticktime) AS time ,
- max(last_price) OVER w AS high ,
- min(last_price) OVER w AS low
- FROM czces
- WHERE product_type ='TA' AND contract_month = '2014-08-01 00:00:00'::TIMESTAMP
- WINDOW w AS (
- PARTITION BY date_trunc('second', ticktime)
- ORDER BY ticktime ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
- )
- ) t USING (time)
- ORDER BY 1
- ) AS t ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement