The following is an example for the requirement I have.I have 2 tables. User table and another table where I enter the food user likes.
Long id (auto-generated)
insert into user_food (user_id,food) values (select user_id from user_food where food="French Toast","Orange Juice");
syntax error at or near "select"
The following query will add orange juice records for all users who have at least one french toast record.
INSERT INTO user_food (user_id, food) SELECT DISTINCT user_id, 'Orange Juice' FROM user_food WHERE user_id IN (SELECT user_id FROM user_food WHERE food = 'French Toast')