SELECT * FROM myTable WHERE theColumn RLIKE '^[^AZ]'
Explanation
With the RLIKE predicate, the pattern in square brackets denotes any character indicated in the bracket (allowing you to use a dash to indicate ranges, as here, AZ "from A to Z").
Pay attention to two characters; they have a very clear meaning:
The first means "beginning of line"
Another ^ character in parentheses indicates that the pattern must match any character that is not listed in parentheses.
See mySQL template documentation for more details.
Can also be written as an alternative, as follows
... WHERE theColumn NOT RLIKE '^[AZ]'
A word of caution . Regardless of the syntax in square brackets, the patterns shown above use a “front end wildcard” that can only be processed with a table / scan index (or at least partial scan), and this can be relatively inefficient with large tables .
source share