Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT origin, id,
- (SELECT COUNT(*)
- FROM flights f
- WHERE f.id < flights.id
- AND f.origin=flights.origin) + 1
- AS flight_sequence_number
- FROM flights;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement