MySQL makes stuff easy

Recently, had to

MIGRATE `some`, `product`, `tables` FROM `different sources` WHERE `someone apparently typed letters in fields that were supposed to hold numbers only`;

Only problem: the table holds nearly 3000 rows.

So I used a regular expression:

SELECT * FROM `products` WHERE `price` REGEXP '[:alnum:]';

It took 0.0434 sec for MySQL to identify the badboys ;)

This entry was posted on Wednesday, July 1st, 2009 at 12:19 pm and is filed under MySQL. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

Anti-Spam Protection by WP-SpamFree