Question: I am trying to figure out if it is possible to check if a specific record exists in table B. if so, don't update table A.

I have tried googling, but I only find the insert version and I'm not sure if it's even possible with an update query.

Thanks in advance

Answer: 
```
update table_to_update 
set some_column = 123
where id = 1
and id not in (select id from table_b)

```
You could also try with MySQL [exists](http://dev.mysql.com/doc/refman/5.0/en/exists-and-not-exists-subqueries.html) expression. Using exists syntax on older MySQL versions i.e. 5.0 proved for me to be faster than using nested query.

```
update table_a
set some_column = 'bla'
where not exists (select id
                        from table_b
                        where table_a.id = table_b.id)

```