Reputation: 321
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?
Upvotes: 1
Views: 340
Reputation: 35572
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));
Upvotes: 1
Reputation: 24046
you could update the table
update pnrdetails
set FlightId =RIGHT(flightnumber, 4)
Upvotes: 0