Jump to content


Getting distict records

get distinct records

  • Please log in to reply
3 replies to this topic

#1 bluepicaso

bluepicaso

    Member

  • Members
  • PipPip
  • 21 posts
  • LocationIndia

Posted 12 January 2013 - 08:49 AM

hey,
i am facing a problem with showing distinct records.
my table structure
Posted Image

and i simple want to run this query in CRUD
select distinct(proCode) from products

showing only distinct records.

Thank you

Harpreet Singh Bhatia
[web developer, programmer, entrepreneur]
Portfolio: TheCodingBox


Follow Me: facebook.png twitter.png googleplus.pngskype.png


#2 cleberkr

cleberkr

    Member

  • Members
  • PipPip
  • 11 posts

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}`.*";


#3 cleberkr

cleberkr

    Member

  • Members
  • PipPip
  • 11 posts

Posted 17 November 2017 - 03:19 AM

This could be added to core! ?



#4 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

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 :)







Also tagged with one or more of these keywords: get, distinct, records

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users