title: How to combine multiple SQL queries into a single one?
body: <p>I have these multiple sql queries that I want to bundle together into one single query, so that I can avoid sending multiple requests to the database from my application ( I want to receive all of these data in one single shot) :</p>
  
  <pre><code>1) select pin, officeNum, isVeteran from table18 where pin = 123;
  
  2) select streetAddress, apartmentAddress, cityAddress, stateAddress from table1 where case = (select case from table18 where pin = 123);
  
  3) select unitAddress, cityAddress, streetAddress, apartmentAddress from table5 where pin = 123;
  
  4) select unitAddress, cityAddress, streetAddress, apartmentAddress from table55 where seqNum = 0 and rfa = (select rfa from table18 where pin = 123);
  
  5) select unitAddress, cityAddress, streetAddress, apartmentAddress from table103 where histCode = 0 and case = (select case from table18 where pin = 123);
  
  6) select phone, email from table715 where histSeqNum in (select max(histSeqNum from table715))
        and histCode in (select max(histCode) from table715)
        and case = (select case from table18 where pin = 123);
  </code></pre>
  
  <p>Here is my schema : </p>
  
  <p>(Please excuse the bad design, it's from a database created 20 years ago, there is no foreign keys)</p>
  
  <p>-Table18 ( pin(PK), case, officeNum, isVeteran )</p>
  
  <p>-Table1 (case(PK), caseOfficer, streetAddress, apartmentAddress, cityAddress, stateAddress)</p>
  
  <p>-Table5 (pin(PK), streetAddress, apartmentAddress, cityAddress, stateAddress)</p>
  
  <p>-Table55 (rfa(CompositeKey), seqNum(CompositeKey), rfaAddress, streetAddress, apartmentAddress, cityAddress, stateAddress)</p>
  
  <p>-Table103 (case(CompositeKey), histCode(CompositeKey) )</p>
  
  <p>-Table715 (case(CompositeKey), histSeqNum(CompositeKey), histCode(CompositeKey), phone, email ) </p>