Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. update tmp_tbl
  2. set prior_symbol = (select o.symbol
  3. from options o
  4. where o.underlying_ticker = tmp_tbl.underlying_ticker
  5. and o.option_type = tmp_tbl.option_type
  6. and o.expiration = tmp_tbl.expiration
  7. and o.strike = (select max(o2.strike)
  8. from options o2
  9. where o2.underlying_ticker = tmp_tbl.underlying_ticker
  10. and o2.option_type = tmp_tbl.option_type
  11. and o2.expiration = tmp_tbl.expiration
  12. and o2.strike < tmp_tbl.strike));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement