MySQL Forums
Forum List  »  Newbie

Update with a Limit
Posted by: derek walsh
Date: March 20, 2005 11:12AM

Here is my code:

UPDATE donation2,donors1 SET donation2.status = 'booked', donation2.hospital_id= '$hospital_id' WHERE donation2.status = 'available' and donation2.hospital_id='' and donation2.username= donors1.username and donors1.blood_type='$blood_type' LIMIT $quantit

basically, I want to update certain rows matching the username. THis does update all the rows which the username matches but it doesn't limit them.

AN error is returned: ERROR 1221: Wrong usage of UPDATE and LIMIT.


Any help would be great

Options: ReplyQuote


Subject
Written By
Posted
Update with a Limit
March 20, 2005 11:12AM
March 20, 2005 11:25AM
March 21, 2005 05:53AM
March 23, 2005 01:23PM
March 24, 2005 03:50PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.