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'
精彩评论