If you want to update every second row (actually its updating odd and even rows in MySQL table) then this is a small trick i found on one 7 years old printout.
So the problem with me was that i accidentally updated one enum column on all rows so this table…
+---+---+
| 1 | A |
| 2 | b |
| 3 | A |
| 4 | b |
| 5 | A |
+---+---+
…turned out to have B’s everywhere, but i just wanted to capitalize them where they are…
+---+---+
| 1 | B |
| 2 | B |
| 3 | B |
| 4 | B |
| 5 | B |
+---+---+
…first i got depressed (because manually changing 1000 rows wasnt included in todays plans), so i remember i had something similar many years ago and guess what – found it. Solution was to use mod() to detect if row id was odd or even…
update `table1` set value='A' where MOD(id,2) = 1;
update `table1` set value='B' where MOD(id,2) = 0;
… and voila! my day (night, actually) is saved…
+---+---+
| 1 | A |
| 2 | B |
| 3 | A |
| 4 | B |
| 5 | A |
+---+---+
Of course, it doesnt help you if id’s are mixed or even more sad – no id’s at all. Well, if you know better solution – would be appreciated.




At this time it seems like Expression Engine is the best blogging platform out there right now. (from what I’ve read) Is that what you are using on your blog?
Howdy! I could have sworn I’ve been to this site before but after checking through some of the post I realized it’s new to me. Anyways, I’m definitely delighted I found it and I’ll be bookmarking and checking back often!
When Adam delved and Even span who was then the gentleman?
Excellent post. I learned a lot reading it. Thanks.
That’s what i call “great post”. Thank you so much.
Thank you for http://edgars.cellfex.org/2010/07/30/mysql-update-every-second-row/: some other sort of excellent post. Where else could anybody get that form of information in such a great means of writing? I have a presentation in a month’s time, and I am to the look for such knowledge.
Thanks a lot for giving everyone remarkably spectacular chance to read from this web site. It is usually so pleasant and also packed with a great time for me personally and my office acquaintances to visit the blog really three times in one week to read the new tips you have. And of course, I am just at all times motivated concerning the unbelievable creative concepts you serve. Selected 3 areas on this page are basically the most suitable I’ve had.
Thank you for some other great article.
Actually good style and design and excellent content material , absolutely nothing at all else we want : D.
Your page looks a bit strange when i use my mobile browser on my samsung. You want to check that please.
I’ve recently started a website, the information you offer on this website has helped me tremendously. Thank you for all of your time & work.
When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get three e-mails with the same comment. Is there any way you can remove people from that service? Thanks!
That’s what i call “great post”. Thank you so much.
That’s what i call “great post”. Thank you so much.
Really nice style and excellent content , practically nothing else we want : D.
Excellent post, mate! Thanks for the useful information
The devil was sick the Devil a saint would be the Devil was well the devil a saint was he.
Excellent post, mate! Thanks for the useful information
That’s a great post. Thank you so much.
I like how this material reads. Your points are thought-provoking. This is tangible information I can wrap my brain around and appreciate. You have proven nothing is black and white. http://www.samsung1080phdtv.net/
pretty practical stuff, overall I think this is well worth a bookmark, thanks
That’s what i call “great post”. Thank you so much.
I like this post, enjoyed this one thanks for posting .
Change yourself change your fortunes.
I truly appreciated this amazing blog. Make certain you maintain up the excellent function. All the finest !!!!
Have you guys ever considered he may have personal experience with this? It was well written afterall.
There is a time for everything.
One thing I’d prefer to discuss is that weightloss routine fast can be carried out by the appropriate diet and exercise. An individual’s size not only affects appearance, but also the general quality of life. Self-esteem, depressive disorders, health risks, as well as physical abilities are disturbed in extra weight. It is possible to do everything right whilst still having a gain. Should this happen, a medical problem may be the offender. While an excessive amount of food rather than enough body exercise are usually at fault, common medical ailments and trusted prescriptions might greatly add to size. Thanks alot : ) for your post in this article.
naturally like your web site but you have to test the spelling on quite a few of your posts. A number of them are rife with spelling issues and I find it very bothersome to inform the reality nevertheless I’ll surely come back again.
As I site possessor I believe the content material here is rattling excellent , appreciate it for your efforts. You should keep it up forever! Good Luck.
That’s a great post. Thank you so much.
Excellent post, mate! Thanks for the useful information
That’s a great post. Thank you so much.
Hello, how’s it going? Just shared this post with a colleague, we had a good laugh.
That’s a great post. Thank you so much.
I precisely needed to say thanks again. I do not know the things that I could possibly have handled in the absence of these tactics discussed by you over this subject. Completely was a very frightful crisis for me personally, but taking note of a specialised style you solved it forced me to jump for contentment. I’m just grateful for this support and in addition believe you really know what a great job you have been accomplishing instructing the rest via your webpage. I’m certain you haven’t got to know any of us.
There is noticeably a bundle to know about this. I assume you made certain nice points in features also.
You’re so interesting! I don’t suppose Ive look over anything like this previously. So great to search out person with a few genuine thoughts on it all issue. realy appreciate it for starting it all up. this page can be something is required on the web, somebody by having a little creativity. valuable work for bringing some thing new to the web!
you’ve a excellent blog here! would you like to make some invite posts on my blogs?
Nice post. I learn something more challenging on different blogs everyday. It will always be stimulating to read content material from other writers and practice a bit something from their store. I’d prefer to use some with the content material on my weblog whether you don’t mind. Natually I’ll give you a link on your web weblog. Thanks for sharing.