Address Table with 50 records. Has a bool field called "primary_address_indicator". I want to update a selected record to true and automatically set all other 49 records to false.
I know I can do this with 2 sql statements First (update all records to false)
UPDATE address SET address.primary_address_indicator=0
Then (update specific record to true)
UPDATE address SET address.primary_address_indicator=1 WHERE address.record_id=31
Is there a way to do this in a single sql statement? Something like @Rank? Keeping it simple... no Unions or some weird self table join. Maybe what I am looking for does not exist...and that is fine too. just curious.