title: SQL Three Queries combined into three columns
body: <p>I have three queries I would like to combine into three columns.</p>
  
  <p>I am looking for this output:</p>
  
  <p>DEPTNAME1 -----  Count(distinct pat_id <strong>Q1</strong>) -----  Count(distinct pat_id <strong>Q2</strong>) -----  Count(distinct pat_id <strong>Q1</strong>)/Count(distinct pat_id <strong>Q2</strong>)</p>
  
  <p>DEPTNAME2 -----  Count(distinct pat_id <strong>Q1</strong>) -----  Count(distinct pat_id <strong>Q2</strong>) -----  Count(distinct pat_id <strong>Q1</strong>)/Count(distinct pat_id <strong>Q2</strong>)</p>
  
  <p>ETC</p>
  
  <p><strong>My current code for Q1:</strong></p>
  
  <pre><code>select DEP.DEPARTMENT_NAME,
  count(distinct hsp.pat_id)
  from pat_enc_hsp hsp
  left outer join clarity_adt adt
  on hsp.pat_enc_csn_id = adt.pat_enc_csn_id
  left outer join clarity_dep dep
  on ADT.DEPARTMENT_ID = dep.DEPARTMENT_ID
  inner join patient pat
  on hsp.PAT_ID = pat.PAT_ID
  left outer join ip_flwsht_rec rec
  on rec.INPATIENT_DATA_ID = hsp.INPATIENT_DATA_ID
  left outer join ip_flwsht_meas meas
  on rec.FSD_ID = meas.FSD_ID
  left outer join ip_flo_gp_data
  on meas.FLO_MEAS_ID = ip_flo_gp_data.FLO_MEAS_ID
  where adt.department_id IN (1,2,3,4,5) 
  and (hsp.ed_disposition_c is null or hsp.ed_disposition_c not in ('5','6'))
  and hsp.HOSP_ADMSN_TIME between TO_DATE ('08-10-2014 00:00:00', 'DD-MM-YYYY HH24:MI:SS') and TO_DATE ('08-10-2014 23:59:59', 'DD-MM-YYYY HH24:MI:SS')
  GROUP BY DEP.DEPARTMENT_NAME
  </code></pre>
  
  <p><strong>My current code for Q2:</strong></p>
  
  <pre><code>select DEP.DEPARTMENT_NAME,
  count(distinct hsp.pat_id)
  from pat_enc_hsp hsp
  left outer join clarity_adt adt
  on hsp.pat_enc_csn_id = adt.pat_enc_csn_id
  left outer join clarity_dep dep
  on ADT.DEPARTMENT_ID = dep.DEPARTMENT_ID
  inner join patient pat
  on hsp.PAT_ID = pat.PAT_ID
  left outer join ip_flwsht_rec rec
  on rec.INPATIENT_DATA_ID = hsp.INPATIENT_DATA_ID
  left outer join ip_flwsht_meas meas
  on rec.FSD_ID = meas.FSD_ID
  left outer join ip_flo_gp_data
  on meas.FLO_MEAS_ID = ip_flo_gp_data.FLO_MEAS_ID
  where adt.department_id IN (1,2,3,4,5) 
  and (hsp.ed_disposition_c is null or hsp.ed_disposition_c not in ('5','6'))
  and hsp.HOSP_ADMSN_TIME between TO_DATE ('08-10-2014 00:00:00', 'DD-MM-YYYY HH24:MI:SS') and TO_DATE ('08-10-2014 23:59:59', 'DD-MM-YYYY HH24:MI:SS')
  and meas.flo_meas_id in ('00',
  '7',
  '8',
  '9',
  '0')
  GROUP BY DEP.DEPARTMENT_NAME
  </code></pre>
  
  <p><strong>Q3</strong> is output from specific row Q1 / output from specific row Q2:</p>
  
  <p>Thank you for all help</p>