I have two tables:
| title | id |
| sometext | 1 |
| othertext | 2 |
---------------------
| last_id | id |
| 0 | 1 |
| 1 | 2 |
I want to update table1 where table1.id and table2.last_id have the same values.
Here is the mysql query I'm using
UPDATE table1 SET title='newvalue' where table1.id=table2.last_id;
This query is supposed to change "sometext" to "newvalue". But this is not working.
Any ideas as to why?
Funny enough, if I issue the direct query:
UPDATE table1 SET title='newvalue' WHERE table1.id=1;
the update works.