Reputation: 25
I have two tables users(id, username, password) and user_badges(user_id, badge_id, badge_slot)
I would like to insert the data (id from user table, FBB, 0) for every row in the users table.
How can I do this?
Thanks!
Upvotes: 0
Views: 411
Reputation: 230296
You want this?
INSERT INTO user_badges(user_id, badge_id, badge_slot)
SELECT id, 'FBB', 0
FROM users;
Upvotes: 5