Normally I'd do my homework properly first, but I'm up against a deadline now and thought I'd throw this out there for some help, mainly because I know from previous experience anything I think is complex is actually a breeze for SQL.
I'm looking to group my results by a letter range, not just an individual letter. So, ultimately I'd like my output to be something like
ABCD:
-- Alpha
-- Bravo
-- Charlie
-- Delta
EFGH:
-- Echo
-- Foxtrot
-- Gulf
-- Hotel
Until now I've been using ORDER BY LOWER(name) ASC
and then just copying records into an array structure to get the single letter grouping (A, B, C, etc.), but that would need expanding to group by a letter range, and I'm wondering it there's a faster/more efficient way of doing it.
Pure SQL solution? Or post-processing in PHP?
Tips, tricks, full answers appreciated as always.