Последние записи

Пример JOIN и UPDATE

Дата: 04-12-2014

UPDATE products_prices as pp
		INNER JOIN products as pr
		ON pp.product_id=pr.id
SET price=price*1.1
WHERE pr.category_id=1
UPDATE products_prices as pp
                 INNER JOIN products as pr
                 ON pp.product_id=pr.id
                              INNER JOIN brands as br
                              ON pr.brand_id=br.id
 SET price=price*$koef
 WHERE br.id=$brand_id

Категория: PHP