title: How can I sort data into 3 alphabetical subgroups with SQL?
body: <p>I'm displaying student data for teachers at my school using SQL, and for usability reasons it needs to be displayed with very unique sorting, with 3 subsets of the alphabet dividing the dataset, then normal sorting within that.</p>
  
  <p>It should spit out something like this:</p>
  
  <p>Last names A-F, sorted by period, then by last name</p>
  
  <p>Last names G-O, sorted by period, then by last name</p>
  
  <p>Last names P-Z, sorted by period, then by last name</p>
  
  <p>It's currently sorted by period and last name fairly simply, and I can use three different queries to split the data as such, but I don't know how to do it all in one.</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT * FROM Student ORDER BY per, last;
  </code></pre>