Reputation: 33644
Is there a way to combine these sql statement
UPDATE foreign_users_to_be_mentioned SET is_used = 1 WHERE id = 1
UPDATE foreign_users_to_be_mentioned SET is_used = 1 WHERE id = 2
into a single query ?
Upvotes: 0
Views: 36
Reputation: 222402
Use IN
:
UPDATE foreign_users_to_be_mentioned SET is_used = 1 WHERE id IN (1, 2)
Upvotes: 4