Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select a.time_stamp / 100000 as bar_time, a.price as bar_open,
- b.bar_high, b.bar_low, c.price as bar_close
- FROM
- (
- select max(price) as bar_high, min(price) as bar_low, min(id) as first_id, max(id) as last_id
- from [20160104]
- where symbol = 'AAPL' and price_field = 0
- group by (time_stamp / 100000)
- ) as b
- join [20160104] as a on b.first_id = a.id
- join [20160104] as c on b.last_id = c.id
- order by bar_time
Add Comment
Please, Sign In to add comment