I have a table UserCompany:
A user can have serveral rows in the table, connected to several Companies.
I want to update the row with the min(CompanyID) and set defauly = true:
I can select the rows:
Select min(CompanyID) as comp,UserID
from UserCompany uc
where DefaultCompany <> 1
group by UserID
But can seem to figure out how to update the same rows?