Skip to Content

Value-Range Pattern Matching in SQL Command

Feb 10, 2017 at 12:06 AM


avatar image
Former Member

I like using the SQL Command under the Database Expert. However, I noticed that pattern matching against a range of values doesn't seem to work as it should.

I want to return all records whose ID# ends with an alphabetic letter. (Note that this ID field is a String)

When I use the following command, nothing shows up:

..... WHERE ID LIKE '%[A-Z]'

Some example values in the ID table:

Edit: (I also tried [a-z], doesn't work either)

10 |10000 characters needed characters left characters exceeded

Hi Erikson,

What database are you using? The syntax you use in the SQL Command should be the syntax for your database.

If you were to use the same syntax in your database, does it work? Instead of Like, could you use the Right function and check if the last value is between 'A' and 'Z'?

Where  Right (table.ID, 1)  Between 'A' and 'Z' 

This works in SQL Server.

Good luck,


* Please Login or Register to Answer, Follow or Comment.

0 Answers