title: How i turned postgres query to query builder format codeigniter?
body: <p>i want to select datas from many tables here is the code
  how to turned this</p>
  
  <pre><code>SELECT a.*, b.penyusun, c.keywords 
                  FROM cb_monograf a 
                  INNER JOIN (
                  select row_number() over (order by id_monograf) nomer, id_monograf, string_agg(id_penyusun::varchar,'-') penyusun
                    from cb_penyusun_monograf
                   group by id_monograf
                  ) b ON a.id_monograf = b.id_monograf
                  INNER JOIN (
                  select row_number() over (order by id_monograf) nomer, id_monograf, string_agg(id_keywords::varchar,'-') keywords
                    from cb_keywords_monograf
                   group by id_monograf
                  ) c ON a.id_monograf = c.id_monograf
                  WHERE a.jenis = 'buku'
  </code></pre>
  
  <p>into somekind of this format</p>
  
  <pre><code>            $this-&gt;db-&gt;select('a.*,b.penyusun')
                  -&gt;from('cb_monograf a')
                  -&gt;join("($subquery1) b","a.id_monograf = b.id_monograf","inner")
                  -&gt;where('jenis', $param_type);
  </code></pre>