简体   繁体   中英

Insert values starting from 1st row onwards

I added a column to a table. The table had 1315 rows.

On adding the column, all values in that column were null.

On inserting values into the column, they are being inserted after the 1315 null values, which doesn't serve my purpose.

I want them to be inserted from the 1st row onward, overwriting all the null values.

insert into projects(project_renewal)
select project_renewal from Project_number

PS: project_renewal column name is same in both tables.

You would seem to want:

update projects p join
       project_number pn
       on p.project_id = pn.project_id  -- guessing at the JOIN key here
    set p.project_renewal = pn.project_renewal;

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM