distinct() Query in Codeigniter

This tutorial shows you how to write distinct query in codeigniter. This method is identical to the Adds the “DISTINCT” keyword to a query.

Let’s create a distinct method in codeigniter

$this->db->distinct();
$this->db->get('table'); 
// Produces: SELECT DISTINCT * FROM table

Leave a Reply

Your email address will not be published. Required fields are marked *