title: strategy for SQL headers and detail report
body: <p>I want to get all schools from the mysql <strong>school</strong> table and get all students of each school in the <strong>students</strong> table. for a web based report with heading and totals.  I could do something like</p>
  
  <p>select * from schools join students on schoolNo = schoolNo order by schoolNo</p>
  
  <p>Howwever this way I think I will have to keep track of current schoolNo and compare with previous schoolNo in order to generate a header and student count totals for each new school.</p>
  
  <p>Alternatively I could do a Select on Schools and additional selects on students for each school found. This is more intuitive but looks very inefficient.</p>
  
  <p>Does mySQL offer a better techniques fot this like specialized reporting  tools like Crystal reports.</p>
  
  <p>thanks</p>