title: Select only unique values from a column in codeigniter
body: <p>i have a table like this</p>
  
  <pre><code>name|subjects|location
  ......................     
  BUET|CSE|Dhaka
  BUET|EEE|Dhaka
  RUET|CE |Rajshahi
  RU  |CE |Rajshahi
  </code></pre>
  
  <p>here all the rows are distinct.And if I use </p>
  
  <pre><code> $this-&gt;db-&gt;select('*') and $this-&gt;db-&gt;distinct() 
  </code></pre>
  
  <p>it would select  all the rows of BUET but i only want like this</p>
  
  <pre><code>name|subjects|location
  ......................     
  BUET|CSE|Dhaka
  RUET|CE |Rajshahi
  RU  |CE |Rajshahi
  </code></pre>
  
  <p>That means only the first column must be distinct and select all the columns as usual.And it would work if i use $this->db->select('name') and <code>$this-&gt;db-&gt;distinct()</code>. Then what would be about the other columns?? </p>
  
  <p>As my original table has many columns so I want to use <code>$this-&gt;db-&gt;select('*')</code>. I think  <code>$this-&gt;db-&gt;distinct()</code> does not take any column as parameter. It differentiate result based on select. How can I do this?  </p>