I am trying to update users.banned values only where the age is 21, and the users_auth.email matches the ban_users.email. (ban_users is a separate table)
UPDATE users_auth
SET users_auth.banned = '1'
WHERE age='21'
INNER JOIN ban_users
ON users_auth.email = ban_users.email
I have found these two posts but both dont seem to help.
SQL Server - inner join when updating
How do I UPDATE from a SELECT in SQL Server?
Thanks for the help.