Hello I am trying todo the following:
However I get an error at 'FROM _Content....'
Any help is much appreciated
Amazing, thank you
or like that
SET p.post_id = c.post_id
FROM Post_Gallery p join _Content AS c
UPDATE Post_Gallery post_id
SET pg.post_id = c.post_id
FROM _Content AS c
WHERE c.id = pg.id
and in from you must join both tables this is where the problem
from table1 join table2
this is a schema
This is why I wish sitepoint hadn't merged mysql in with the other databases forum when they "tidied" up the forums. Either that or everyone should preface their question with choice of database app in a pull-down menu that is a required field before posting.
I have shared your suggestion with the Staff
many query problems can be resolved with sql that is so "vanilla" that it will work in any database
UPDATE is ~not~ in that category
neither are date functions, etc.
so if it matters, and the original poster hasn't declared which database system is being used, i always ask first
I agree, you can always ask, but sometimes being proactive to a problem that is an outcome of consolidation might be a better approach. Asking does typically solve the problem, but I'd like to explore ways of not having to do that (if one exists). Also, I can think of MANY differences just between MySQL and SQL Server, let alone when you add Oracle or Postgress to the mix.