MDWinter
asked on
Find fields that contain non-alpha characters
We have a table within a database that stores codes for our different advertisers.
We used to allow our users to update themselves, but they kept using non-alpha characters in the code.
I now want to tidy up the table by deleting/fixing the fields which contain non alphanumeric characters.
What's the correct query to find them? Can you replace the ??? in my code below:
We used to allow our users to update themselves, but they kept using non-alpha characters in the code.
I now want to tidy up the table by deleting/fixing the fields which contain non alphanumeric characters.
What's the correct query to find them? Can you replace the ??? in my code below:
SELECT sr_code, sr_name
FROM source
WHERE ???
order by sr_code asc;
not regexp '[0-9a-z]';
SELECT sr_code, sr_name
FROM source
WHERE FIELD_NAME not regexp '[0-9a-z]'
order by sr_code asc;
FROM source
WHERE FIELD_NAME not regexp '[0-9a-z]'
order by sr_code asc;
WHERE sr_code REGEXP '[A-Z][a-z]'
sorry mine is wrong I added for the one with alpha
ASKER
Think I might have been unclear. I used the code that theGhost suggested (attached for clarity) but got zero results.
I want any field that CONTAINS a non alpha character. Not any field that contains ONLY non-alphas.
I know for a fact that one of the records has a value of T@ set for sr_code. This should be found by my query...
I want any field that CONTAINS a non alpha character. Not any field that contains ONLY non-alphas.
I know for a fact that one of the records has a value of T@ set for sr_code. This should be found by my query...
SELECT sr_code, sr_name
FROM source
WHERE sr_code not regexp '[0-9a-z]'
order by sr_code asc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You are a gentleman sir!