I do sample from base. There are two tables with goods and product offers (in one product, and in the other sizes and prices).

I now display goods with all offers (if there are 3 sizes, then 3 identical products are displayed), but only one is needed.

$this->db->select('products.id , pro_title, price , products.offline_store , products.trash, products_offers.barcode , photo_id , modified_date , dictionary.value'); $this->db->from('products'); $this->db->join( 'products_offers' , 'products.ind_id = products_offers.ind_id' ); $this->db->join('dictionary' , 'products.brand = dictionary.id'); $this->db->where('sale_a' , '1'); $query = $this->db->get(); $result = $query->result(); return $result; 

Tell me how to make the necessary conclusion. Thank.

  • one
    group group_by () - splash58
  • Yes, it is) Thank you. - Nikita Ryazanov

1 answer 1

As wrote splash58 it was necessary to group group_by ('products.id');

  • Add to the answer a piece of working code. - 0xdb