• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

Update Query in mySQL

I'm wondering how I can do the below query in mySQL. Can someone help please?
Update Picks
			Set Picks.Points = $PointsCorrectScoreJoker
			Inner Join Matches on Picks.MatchesID = Matches.MatchesID
			where Matches.MatchesID = $MatchesID
			and Picks.PickTeamOne = $ActualScore_TeamHome and Picks.PickTeamTwo = $ActualScore_TeamAway
			and Picks.Joker = 1

Open in new window

1 Solution
Move the JOIN clause into the UPDATE section

UPDATE Picks INNER JOIN Matches ON Picks.MatchesID = Matches.MatchesID
SET        Picks.Points = $PointsCorrectScoreJoker
WHERE   Matches.MatchesID = $MatchesID
AND       Picks.PickTeamOne = $ActualScore_TeamHome
AND       Picks.PickTeamTwo = $ActualScore_TeamAway
AND       Picks.Joker = 1
PeterErhardAuthor Commented:
Thanks :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now