VladikOtez

3

Dec 29th, 2016
180
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT origin, id,
  2.     (SELECT COUNT(*)
  3. FROM flights f
  4. WHERE f.id < flights.id
  5. AND f.origin=flights.origin) + 1
  6.  AS flight_sequence_number
  7. FROM flights;
RAW Paste Data