The title is crap because I'm not actually sure what this is called. I ask because I can't be the first to want to do this. (I use "whatever" or WE to mean doesn't matter)
Series table:
id seriesName
1 WE
2 WE
id title series seriesPosition seriesName
1 A 0 0 ""
2 B 1 0 "Part I"
3 F 1 1 "Part II"
4 D 1 2 "Part III"
5 C 2 0 ""
6 E 2 1 "The return"
7 G 0 0 ""
I'd like to sort is so the data set is in the order the table above is in. That is to say that the title is sorted into ascending order but the rest of a series follows the first in that series. This is why 3 and 4 follow 2 despite 5 coming before 3 alphabetically.
I'm guessing this can't be done in SQL though. So instead I'd like to select things (uniquely) with a non-zero series, but I'd like to select the lowest-titled one. Then when I'm processing results I can see the non-zero seriesId and load the data as needed.
I'm using SQLite.
I don't think I can use group by because all the records with seriesIds equal to zero are logically unique. Can this be done in SQL (or what's the closest I can get), or will it have to be done my side of the interface?
I also say families because that's sort of what a series represents, a family of books.