I would like to join two tables on flightnumbers in 2 steps.
- full flight number match – like ‘BUD1234’ matches ‘BUD123’
- airline code match – like ‘BUD123’ matches ‘BUD’, but not ‘BU’ and ‘BU123’ does not match ‘BUD’
My idea was to find the position of the first numeric character and match on the alphabet prefix, but it might be too slow. Is here any better solution for this?
You could use positive lookahead. Something like:
This will capture just the airline code, which you can then match on