Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select
- b.`ID` AS `ID`,
- c.`product_id` AS `product_id`,
- c.`prezzo` AS `prezzo`,
- c.`disponibili` AS `quantity_max`,
- a.`ID` AS `user_id`,
- b.`quantity` AS `quantity_ask`,
- (
- SELECT
- SUM(h.prezzo * g.quantity) AS total_price_prod
- FROM
- amz_usr as f inner join amz_cart as g on f.ID = g.user_id inner join amz_prod as h on g.product_id = h.product_id
- WHERE
- c.`product_id` = g.`product_id` AND a.`ID` = g.`user_id`
- ) AS `total_price_prod`
- from
- amz_usr as a inner join amz_cart as b on a.ID = b.user_id inner join amz_prod as c on b.product_id = c.product_id;
Add Comment
Please, Sign In to add comment