I want to multiply 2 columns in a single table the thing is one column is in the table but the other one is calculated.
My table structure :
cart_id(pk) pro_id(fk) pro_name pro_price
My query is:
SELECT *, COUNT(pro_id) AS ID
FROM cart
WHERE session_id='" . $_SESSION['session'] . "'
GROUP BY pro_id;
Now I want to calculate product price (pro_price) multiply ID which does not exist but calculated by product counts (count(pro_id)AS ID ).