tags:

views:

227

answers:

1
+5  A: 
UPDATE users u
SET status = 1
WHERE EXISTS (SELECT id FROM usersold WHERE id = u.id)

Alternate version:

UPDATE users
SET status = 1
WHERE id IN (SELECT id FROM usersold)

You should test and, depending on your database, you may find one performs better than the other although I expect any decent database will optimize then to be much the same anyway.

cletus