insert/update change one column
Posted: Sun Feb 18, 2018 10:51 am
I'm looking to copy and insert multiple rows from the same table, changing the data in one column on the insert. I'm running into a conflict with the 'record_id' - I've also tried this code below without the record_id - I'm getting either "record_id already exists" or "not-null constraint"
Thanks in advance for any suggestions.
- Code: Select all
insert into table1 (record_id, columnA, columnB, columnC)
select record_id, columnA, columnB, '123456789'
from table1
where record_id between 1710330 and 1710500
Thanks in advance for any suggestions.