I have a table like the following:
owner Pet
__________
Bob Joe
Sam Rob
Bob George
Phil Marge
Now, I want to create an INSERT statement for a new Owner, Nick. I want to make my insert statement such that for every pet that Bob owns, Nick owns one of the same name.
I’m trying to do this to accomplish my task:
INSERT INTO TABLE
VALUES ('Nick', Pet)
SELECT Pet FROM Table T
WHERE T.owner = 'Bob')
But the above isn’t working. Can anyone please tell me what I’m doing wrong?
You were close: