I have a database table with a column named featured which is used to highlight featured content on a page. Currently, I'm using two SQL statements to toggle the featured rows on/off like so:
-- Reset everything to non-featured
UPDATE tbl SET featured = '0';
-- Now set the selected rows as featured.
UPDATE tbl SET featured = '1' WHERE id IN (4, 10, 21);
Is it possible to combine both of these into one statement?