Skip to content

Instantly share code, notes, and snippets.

@jamiejackson
Created January 18, 2012 22:16
Show Gist options
  • Save jamiejackson/1636160 to your computer and use it in GitHub Desktop.
Save jamiejackson/1636160 to your computer and use it in GitHub Desktop.
Joined MySQL SQL Update
mysql> update cwv
-> set
-> monthly_visits='72',
-> mv_numerator='11909',
-> mv_denominator='16444',
-> visits_in_the_home='100',
-> vih_numerator='95976',
-> vih_denominator='96382'
-> from caseworker_visits cwv
-> inner join states s
-> on s.id = cwv.state_id
-> where
-> s.name = 'Oklahoma'
-> and cwv.year=2007;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from caseworker_visits cwv
inner join states s
on s.id = cwv.state_id
w' at line 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment