Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- update tmp_tbl
- set prior_symbol = (select o.symbol
- from options o
- where o.underlying_ticker = tmp_tbl.underlying_ticker
- and o.option_type = tmp_tbl.option_type
- and o.expiration = tmp_tbl.expiration
- and o.strike = (select max(o2.strike)
- from options o2
- where o2.underlying_ticker = tmp_tbl.underlying_ticker
- and o2.option_type = tmp_tbl.option_type
- and o2.expiration = tmp_tbl.expiration
- and o2.strike < tmp_tbl.strike));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement