title: issues in table alias in codeigniter
body: <p>Here, I am creating an alias for the inner selection, but it automatically adds the table prefix to the alias table. My sql query is as follows:</p>
  
  <pre><code>SELECT
      `tb1`.*, `tb2`.*, `tb3`.`client_name`,
      `cms_tb4`.*,  `tb1`.`project_status` AS pstat
  FROM
      (`cms_projects` tb1)
  JOIN  `cms_project_type` tb2 ON `tb2`.`id` = `tb1`.`project_type`
  JOIN  `cms_clients` tb3 ON `tb1`.`client_id` = `tb3`.`client_id`
  JOIN  (
      SELECT
          *
      FROM
          (
              SELECT
                  t1.project_id AS projid,
                   t2.work_id,
                  t2.work_date
              FROM
                  cms_projects_mod t1,
                  cms_work_status_emp  t2
              WHERE
                  t1.module_id = t2.pro_module_id
              ORDER BY
                  t2.work_date DESC
          )  AS subtb4
      GROUP BY
          projid
      ORDER BY
          work_date DESC
  ) AS tb4 ON  `cms_tb4`.`projid` = `tb1`.`project_id`
  LIMIT 50
  </code></pre>
  
  <p>i am working on codeigniter framework.</p>
  
  <hr>
  
  <p>in codeigniter model just like this</p>
  
  <pre><code>         $this-&gt;db-&gt;select('tb1.*');
                  $this-&gt;db-&gt;select('tb1.project_status as pstat');
                  $this-&gt;db-&gt;from('cms_projects tb1');
                 $this-&gt;db-&gt;join('project_type tb2', 'tb2.id=tb1.project_type');
               $this-&gt;db-&gt;join('clients tb3', 'tb1.client_id = tb3.client_id');
              $this-&gt;db-&gt;join("(
                         select * from (
                select t1.project_id as projid,                                     t2.work_id,t2.work_date from cms_projects_mod t1, cms_work_status_emp t2  where  t1.module_id = t2.pro_module_id order by  t2.work_date desc) as subtb4 
   group by  projid  order by  work_date desc ) as tb4 ",
  "tb4.projid = tb1.project_id" ,false);
        $this-&gt;db-&gt;group_by("tb1.project_id");
              $this-&gt;db-&gt;order_by("tb3.work_date",'desc');
  </code></pre>
  
  <p>here i didn't give any prefix in third join tb4 but CI Add automatically when the running time.</p>