Link to home
Start Free TrialLog in
Avatar of fwstealer
fwstealerFlag for United States of America

asked on

update specific rows and fields

I've got a series of fields that need to be updated:
  citypairs,pic,sic,tailno,flightlog,noreceiptsattached,nofuelcards
and shift the data over to the left by 1 for rows with id range between:
   2541 - 2548
   532 - 2538
and set nofuelcards as null

i did this sql query - worked for one row
update table set citypairs = pic from table where id = 2540
update table set pic = sic from table where id = 2540
update table set sic = tailno from table where id = 2540
update table set tailno = flightlog from table where id = 2540
update table set flightlog = noreceiptsattached from table where id = 2540
update table set noreceiptsattached = nofuelcards from table where id = 2540
update table set nofuelcards = null from table where id = 2540

how would i get it to go through a series of specified rows?
SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial