MySQL Forums :: Newbie :: UPDATE a field SEVERAL times in 1 UPDATE


Advanced Search

UPDATE a field SEVERAL times in 1 UPDATE
Posted by: Bigcrime Crimebig ()
Date: August 18, 2010 09:18PM

Hi!

this is a not working example of what I want to do:

UPDATE casinogamers SET bucks = bucks+1 WHERE id IN ('1','2','4','3','4','4');

in this example id 4 is repeated 3 times, but it will be updated just one time.

I want to tell mysql that update each id each time they appear inside IN (...).

NOTE: this is just an example, in my script, I dont know the ID numbers I only know they were recollected by PHP, I dont know how many times they are repeated or which one is repeated. Nother thing you have to know is that the IDs always will be more than 2 millions and update IDs one by one is too much delay, so for this reason I created this topic.

So I think is clear what I need:

UPDATE "each" id "each" time they appear inside IN (...).

Ill appreciate very much your help.



Edited 1 time(s). Last edit at 08/18/2010 09:19PM by Bigcrime Crimebig.

Options: ReplyQuote


Subject Written By Posted
UPDATE a field SEVERAL times in 1 UPDATE Bigcrime Crimebig 08/18/2010 09:18PM
Re: UPDATE a field SEVERAL times in 1 UPDATE Peter Brawley 08/18/2010 09:26PM
Re: UPDATE a field SEVERAL times in 1 UPDATE Bigcrime Crimebig 08/19/2010 05:05AM
Re: UPDATE a field SEVERAL times in 1 UPDATE Sittiporn Jayawan 08/19/2010 05:07AM
Re: UPDATE a field SEVERAL times in 1 UPDATE Phillip Ward 08/19/2010 07:12AM
Re: UPDATE a field SEVERAL times in 1 UPDATE Bigcrime Crimebig 08/19/2010 09:05AM
Re: UPDATE a field SEVERAL times in 1 UPDATE Chad Bourque 08/19/2010 09:38AM
Re: UPDATE a field SEVERAL times in 1 UPDATE Bigcrime Crimebig 08/19/2010 11:02AM
Re: UPDATE a field SEVERAL times in 1 UPDATE Chad Bourque 08/19/2010 11:35AM
Re: UPDATE a field SEVERAL times in 1 UPDATE Bigcrime Crimebig 08/19/2010 08:37PM
Re: UPDATE a field SEVERAL times in 1 UPDATE Peter Brawley 08/19/2010 12:04PM
Re: UPDATE a field SEVERAL times in 1 UPDATE Peter Brawley 08/19/2010 10:37AM
Re: UPDATE a field SEVERAL times in 1 UPDATE Rick James 08/19/2010 08:02PM
Re: UPDATE a field SEVERAL times in 1 UPDATE Bigcrime Crimebig 08/19/2010 09:34PM
Re: UPDATE a field SEVERAL times in 1 UPDATE Bigcrime Crimebig 08/20/2010 08:09AM
Re: UPDATE a field SEVERAL times in 1 UPDATE Chad Bourque 08/20/2010 08:19AM


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.