开发者

Copy records in the same table

I've got column Cars with开发者_开发技巧 column "Owner".

I has one owner , and he has 10 cars.

Now I've 2 additional person who has the same cars, so I need Add 20 records to my table.

Wiht only one column different:

Something like:

Insert into Cars (NameOfCar,NameOfOwner) 
Select NameOfCar,'"Robert Kubica' Where NameOfOwner='Schumacher'. 

Insert into Cars (NameOfCar,NameOfOwner) 
Select NameOfCar,'"Hakashi Honda' Where NameOfOwner='Schumacher'. 


I see that you are missing FROM clause in your queries, please try adding it.


You are missing the From clause:

Insert into cars (NameOfCar,NameOfOwner)
Select NameOfCar, 'Hakashi Honda'
From cars
Where NameOfOwner='Schumacher'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜