One idea could be to create a user-defined function that receives one letter and returns a string with the group to which the letter belongs.
If you name that function "getGroupFor" and it works so that:
getGroupFor('A') returns 'A-C'
getGroupFor('B') returns 'A-C'
... (and so on)
Then you can change your select to group by the output of that function.
SELECT getGroupFor(upper(substr(columnname, 1, 1))) FROM table GROUP BY getGroupFor(upper(substr(columnname, 1, 1)))
You can find how to create user-defined functions for SQLLite by looking at this other question:
How to create custom functions in SQLite
Another way would be to create a table that can map letters to letter-groups, then join the tables and group by the "letter-group" column instead of by the individual letters.