Advertisement
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.`nome_prodotto` AS `nome_prodotto`,
- c.`link_prodotto` AS `link_prodotto`,
- c.`img_link` AS `img_link`,
- c.`prezzo` AS `prezzo`,
- c.`disponibili` AS `quantity_max`,
- c.`venditore` AS `venditore`,
- c.`cat_it` AS `cat_it`,
- a.`user_login` AS `user_login`,
- a.`ID` AS `user_id`,
- a.`email` AS `email`,
- b.`quantity` AS `quantity_ask`,
- b.`date` AS `date`,
- (
- 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`,
- (
- SUM ( total_price_prod ) AS total_price
- ) AS `total_price`,
- 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;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement