I have two columns in a table:
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 FlightId
datatype is int
.
update pnrdetails set FlightId = convert(int,RIGHT(flightnumber, 4));
you could update the table
update pnrdetails
set FlightId =RIGHT(flightnumber, 4)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.