title: How to get min and max value from the same column at same time from database in codeigniter?
body: <p>I want to get the minimum and maximum values, at the same time, with one query in CodeIgniter.</p>
  
  <p>Here is my code snippet:</p>
  
  <pre><code>$this-&gt;db-&gt;select_min('table.col1');
  $this-&gt;db-&gt;select_max('table.col1');
  $this-&gt;db-&gt;select('table.col2');
  $this-&gt;db-&gt;from('atm_rates');
  $this-&gt;db-&gt;order_by('table.col2');
  $query = $this-&gt;db-&gt;get();
  return $query-&gt;result_array();
  </code></pre>