Jump to content

Update statement, how would I select and change 100 random from selection


Recommended Posts

There are about 400 records in a database with a field zabp_package = T_SIMT.

They were uploaded in an order where specific category lists were uploaded together.  For example, first 100 dining, then 75 insurance, then 150 health, then 75 cars.  So from an auto increment standpoint they were inserted in that order.

I want to select at random 100 of these 400 and update two fields.  My update statement is:

update  `usersOld` SET  `m_org` = 'ZABP.org Corporate HQ' , `m_orgID` = 'PFL2a96bW' WHERE `zabp_package` = 'T_SIMT'

This works for all, I just need to limit a random selection to 100.

Any Help on this, thanks in advance.

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

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

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.