I have two columns in a table:
- FlightNumber (which has values such as AI-1234, AI-3242), and
- FlightId (which is supposed to be 1234, 3242 based on the FlightNumber)
I am able to select the FlightNumber column with last 4 characters of each record.
SELECT RIGHT(flightnumber, 4) FROM pnrdetails
But I am not sure how to insert this into the FlightId column. Suggestions?
I guess , you dont need insert. you should be thinking about update.
and I assume
FlightIddatatype isint.