Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. ERROR: JOIN/USING types bigint and timestamp without time zone cannot be matched
  2.  
  3. SELECT
  4. t.high,
  5. t.low
  6. FROM
  7. (
  8.  
  9. SELECT generate_series(
  10. date_trunc('second', min(ticktime)) ,
  11. date_trunc('second', max(ticktime)) ,
  12. interval '1 sec'
  13. ) FROM czces AS g (time)
  14.  
  15. LEFT JOIN
  16. (
  17. SELECT
  18. date_trunc('second', ticktime) AS time ,
  19. max(last_price) OVER w AS high ,
  20. min(last_price) OVER w AS low
  21. FROM czces
  22. WHERE product_type ='TA' AND contract_month = '2014-08-01 00:00:00'::TIMESTAMP
  23. WINDOW w AS (
  24. PARTITION BY date_trunc('second', ticktime)
  25. ORDER BY ticktime ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
  26. )
  27. ) t USING (time)
  28.  
  29.  
  30.  
  31. ORDER BY 1
  32. ) AS t ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement