I am trying to Update a column in a table in one database after doing two inner joins, one of which is with a table from another database on the same server. I was trying to follow this solution here: Update Query with INNER JOIN between tables in 2 different databases on 1 server
This isn't working for me. It gives me: you have an error in your syntax near s_u
Here's my attempt (UPDATE: I removed the code sanitation. So this is the exact code I'm running now):
UPDATE s_u
SET s_u.bill_address_id=spree_billing.id
FROM spree_users AS s_u
INNER JOIN magento.customer_entity_int AS default_billing
ON default_billing.entity_id=s_u.magento_id
AND default_billing.attribute_id=14
INNER JOIN spree_addresses AS spree_billing
ON spree_billing.magento_address_id=default_billing.value;