title: MYSQL ERROR 1096 - NO TABLES USED - CODEIGNITER
body: <p>I am using a custom query as the Active Record equivelant did not work for me.</p>
  
  <p>When placing the Query in my Database Software SQLYOG it works fine however in CodeIgniter it says </p>
  
  <blockquote>
    <p>A Database Error Occurred</p>
    
    <p>Error Number: 1096</p>
    
    <p>No tables used</p>
    
    <p>SELECT *</p>
    
    <p>Filename: C:\xampp\htdocs\midas\system\database\DB_driver.php</p>
    
    <p>Line Number: 330</p>
  </blockquote>
  
  <p>Here is my Query:</p>
  
  <pre><code>SELECT intervention.department_id, department_name, COUNT(*)
  FROM intervention 
  LEFT JOIN department ON department.department_id = intervention.department_id
  
  GROUP BY intervention.department_id, department.department_name
  ORDER BY COUNT(*) desc
  LIMIT 1
  </code></pre>
  
  <p>It is a bit of a strange problem.</p>
  
  <p>Here is my Schema also:</p>
  
  <p><a href="http://i.imgur.com/mKNtc.png" rel="nofollow">http://i.imgur.com/mKNtc.png</a></p>