Sql 如何在向表中插入数据后更新列的值

Sql 如何在向表中插入数据后更新列的值,sql,Sql,我有一个表a,如下所示: ID | ColumnA | ColumnB | ColumnC | 1 | apple | banana | coconut | 2 | x | y | z | 3 | a | b | c | 现在,我想复制ID为2的行,然后插入到tableA并修改y->y1 我编码: update TableA set ColumnB = 'y1' where ID = insert into

我有一个
表a
,如下所示:

ID | ColumnA | ColumnB | ColumnC |
1  | apple   | banana  | coconut |
2  | x       | y       | z       |
3  | a       | b       | c       |
现在,我想复制ID为2的行,然后插入到
tableA
并修改y->y1

我编码:

update TableA
set ColumnB  = 'y1'
where ID = insert into TableA 
            output ID
            select ColumnA , ColumnB , ColumnC 
            from TableA
            where ID = 2

为什么不只使用一个查询

insert into TableA (ColumnA, ColumnB, ColumnC)
    select ColumnA , 'y1' , ColumnC 
    from TableA
    where ID = 2;