Select a Range of Letters
Select the names from 'A'
up to, but not including 'E'
:
select ID, Name
from SampleTable
where Name >= 'A' and Name < 'E'
order by Name
As this is a plain comparison, it can use an index if you have one for that field.
Guffa's answer is probably the most efficient. To be complete, you could also use
LIKE '[a-d]%'
Depending on your database COLLATION
, LIKE
might be case sensitive or not.