I have a database that I am trying to clean out. They have 70k entries with some bad values in the zip code column. I want to go through and delete the rows that do not have a valid 5 or 9 digit zip code. This the current statement I have:
SELECT * FROM `sample_requests` WHERE `request_zip` RegExp '^\d{5}$)|(^\d{5}-\d{4}$)'
I am not very familiar with regular expressions, but I know enough. Also this particular regex is used on the form now, so that it will not submit without a valid zip code so I know it works. I just can't get the MySQL portion to work.