Hello Guys i need your help i just start to learn and i have some trouble to resolve this task
i need to check in table last id product because they repeat some times
i explain better in bms_procurement_purchase_order_product have row product_id and inside this row i have some id repeat and so i need select last data in this row, i already done the script but now i dont understand how to write that this script need take last data in product_id and also have row id_bms_procurement_purchase_order_product
So i think need group but i dont know how
$sql = “UPDATE " . _DB_PREFIX_ . "product_shop
as o inner join " . _DB_PREFIX_ . "bms_procurement_purchase_order_product
as co on o.id_product=co.product_id SET o.wholesale_price = co.price”;
if (!Db::getInstance()->Execute($sql)){
die(‘Error’);
}
//End Step 1
?>