Table students
I am trying to sort by names for letters in range A-M:
I've tried:
SELECT * FROM student WHERE student_first_name like '[A-M]%';
It's not giving me anything.
You are using SQLite which supports the GLOB
operator where you can use the [x-y]
list wildcard and *
instead of %
:
SELECT * FROM student WHERE student_first_name GLOB '[A-M]*';
Note that GLOB
is case sensitive.
If you want case insensitive results use:
SELECT * FROM student WHERE UPPER(student_first_name) GLOB '[A-M]*';