Using SQL LIMIT to get an alphabetical range? ie A-R

Status
Not open for further replies.

Enigmabomb

New member
Feb 26, 2007
2,035
66
0
Than Franthithco
How might I LIMIT my sql statement to return a range of letters from a column. I've had no luck with the regex function. Here's what I want:

Apple
Bear
Charlie
Dog
Echo
Fox
Girl
Zulu

I want to return Bear, Charlie, Dog, Echo (B-E)

SELECT * FROM `items` WHERE ...?

Thanks!

Josh
 


First things first, just saying SQL does not imply MySQL, it could imply many other DBMS.

One simple way..

SELECT * FROM kids WHERE SUBSTRING(retard, 1, 1) BETWEEN 'E' AND 'F';

Also it's not called a limit, it's called a range. Limit implies quantity, range implies subsection.
 
Status
Not open for further replies.