Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

SQL only return values where first letter is between A-Z

I am trying to return only values from a field that have the first letter between A-Z,

I have tried using the below but this only does one letter at a time.

UPPER(LEFT(AD_ADDR,1)) like 'A%'

The other characters will be 0-10, which I want to exclude but are formatted as strings, so using IS_INTEGER doesn’t work.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Using RLIKE:

SELECT *
FROM tab
WHERE AD_ADDR RLIKE '[a-zA-Z].*';
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading