⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Getting distict records



bluepicaso
  • profile picture
  • Member

Posted 12 January 2013 - 08:49 AM

hey,
i am facing a problem with showing distinct records.
my table structure
[img]http://i.imgur.com/idHte.png[/img]

and i simple want to run this query in CRUD

select distinct(proCode) from products


showing only distinct records.

Thank you

cleberkr
  • profile picture
  • Member

Posted 17 November 2017 - 03:19 AM

change in grocery_crud_model.php line 53:

 

    function get_list()
    {
    if($this->table_name === null)
    return false;
 
    $select = "distinct `{$this->table_name}`.*";

cleberkr
  • profile picture
  • Member

Posted 17 November 2017 - 03:19 AM

This could be added to core! ?


Amit Shah
  • profile picture
  • Member

Posted 17 November 2017 - 10:23 AM

I will not recommend hampering the core library - rather this is an uncommon requirement - i will recommend you to use custom model for the same.

 

Happy GCing :)