i am totally depressed with this query, which i am solving for many hours :(
SELECT m_order.id,
(SELECT SUM(price*amount) FROM m_order_item as item WHERE item.id_order = m_order.id) AS total
FROM `m_order`
WHERE total > 100
It returns Unknown column 'total' in 'where clause' constantly, but in result without this problematic where clause column with name "total" is totally ok and calculated.
Thanks for any help.