title: JOINING 2 MYSQL queries
body: <p>I have two queries below, the first one is query for my <strong>DataTables</strong> and the second one is for the regular HTML table.</p>
  
  <p>The first query is:</p>
  
  <pre><code>SELECT a.*, b.personnel_name 
  FROM `work_order` as a 
  LEFT JOIN `personnel_master_data` as b ON a.`reg_no` = b.`reg_no` 
  WHERE a.`status` = 'Continue' 
  GROUP BY `id` 
  $sOrder 
  $sLimit
  </code></pre>
  
  <p>I executed the query in my php file and DataTables works perfectly, and now the second query:</p>
  
  <pre><code>SELECT d.`wo_number`, SUM(d.`crew_est` * d.`manhour_est`) AS 'crew_kali_manhours', 
      CONCAT(((SUM(d.`crew_est` * d.`manhour_est`) / 
              (SELECT SUM(c.`crew_est` * c.`manhour_est`) 
               FROM `work_sheet_machine` AS c 
               WHERE c.`wo_number` = '$wo_number')) * 100)) AS `progress` 
  FROM `work_sheet_machine` AS d 
  WHERE d.`status` = 'FINISH' AND d.`wo_number` = '$wo_number'
  </code></pre>
  
  <p>The second query seems working good on regular HTML Table with GET parameters. I need to join the second query with the first query and use that query on <strong>DataTables</strong> server side processing file. I'm having problem on joining <code>progress</code> field from second query into first query.</p>