Error in computed Field of select Query
- by Shehzad Bilal
This Query is giving me an error of #1054 - Unknown column 'totalamount' in 'where clause'
SELECT (amount1 + amount2) as totalamount
FROM `Donation`
WHERE totalamount > 1000
I know i can resolve this error by using group by clause and replace my where condition with having clause. But is there any other solution beside using having clause. If group by is the only solution then I want to know why I have to use group by clause even I havent use any aggregate function
thanks.