SQL Group By Query Function in CodeIgniter Framework – group_by()

You can use GROUP BY function with SELECT statement in CodeIgniter. When you use the GROUP BY function it will divide similar data into classes.

You can use a GROUP BY clause in CodeIgniter framework like on the below.

$this->db->group_by("start_date");

// GROUP BY start_date

You can create a statement that has multiple values such as below.

$this->db->group_by(array("start_date", "end_date"));

// GROUP BY start_date, end_date

Published by

Emrah Gümüş

Full Stack PHP Developer, Database Administrator

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.