Jump to content

Update Query Error


millsy007

Recommended Posts

Hi, I would appreciate some help, I cannot get my query to work:

 

UPDATE    journey j

SET          j.occupancy=j.occupancy-1

              Inner Join passengers p

              On p.journey_id = j.id

              Inner Join shuttle s

              On s.id = j.shuttle_id

WHERE      s.id = '1'

AND          p.passenger_name = 'bill gates'

 

It is used when a cancelation is made to reduce the occupancy for that journey to reflect that passenger cancelling, my table/field names are okay and my links are right but I get the error:

 

#1064 - 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 'Inner Join journey On passengers.journey_id = journey.id' at line 3

 

Not sure if relevant but I have MySQL client version: 4.1.22 - Server version: 5.0.51a-community

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.