我想为每个id插入一个新行(删除),如下所示。我该怎么办?
id location action
1 a add
2 b add
3 c add
要---->
id location action
1 a add
1 a remove
2 b add
2 b remove
3 c add
3 c remove
答案 0 :(得分:2)
INSERT INTO TableName (id, Location, action)
SELECT id, Location, 'remove'
FROM TableName