I have a table stock where have the columns id_stock, id_product_stock. When I join the products with stock and if have more than one stock with the same product, this product its repeated in the return of the query. I don't want this product being repeat. Although I want do it just with SQL.
$this->db->join('products', 'products.id_products = stock.id_produtc_stock','left');
Example: if have three(3) data stock with the same id_product_stock the return will be in 3 results; I want the return be in just 1, because the return in the data of the stock have the same id_product_stock. Also if this return have more one id_product_stock different of the other.
I tried to change the tables in the query, but it returns the data in the same way.