Gives a syntax error (1064):
UPDATE contacts
SET contacts.date_entered=contacts_old.date_entered
FROM contacts INNER JOIN contacts_old
ON contacts.id=contacts_old.id;
Works fine:
SELECT contacts.id, contacts_old.id
FROM contacts INNER JOIN contacts_old
ON contacts.id=contacts_old.id;
This is driving me nuts!
MySQL 5045
Got the job done using an UPDATE-WHERE query:
UPDATE contacts, contacts_old
SET contacts.date_entered=contacts_old.date_entered
WHERE contacts.id=contacts_old.id;
I'd still like to know why the UPDATE-FROM-JOIN query doesn't work
I deal mainly with SQL Server 2K. I have poked around just a tiny bit with MYSQL and I ran into your exact problem. It appears that, as usual, Microsoft has developed their own flavor of SQL that is just different enough that other people's stuff won't work. The Update clause is one of those places. I, too, usually use an update from clause like your first one. I had to use the version like your second statement to get it to work with that mysql database.