ich diese Abfrage hier getan So habeWie man ein Produkt von zwei Spalten in einer SQL-Abfrage rund
SELECT p.id product_id
, o.id order_id
, u.id user_id
, o.quantity
, o.created_at
, o.total
, o.quantity * p.price total
, o.created_at
, p.price
, p.name
, u.username
FROM products p
LEFT
JOIN orders o
ON o.product_id = p.id
LEFT
JOIN users u
ON u.id = o.user_id;
ich die Multiplikation runden mag
o.quantity * p.price AS total
aber die Funktion ROUND() wird nicht nehmen
ROUND(o.quantity * p.price AS total, 2)
und das hat nicht funktioniert entweder
o.quantity * p.price AS total, ROUND(total, 2)
Wie kann ich das Produkt o.quantity und p.price innerhalb der Abfrage runden?