Error in computed Field of select Query

Posted by Shehzad Bilal on Stack Overflow See other posts from Stack Overflow or by Shehzad Bilal
Published on 2012-06-23T14:55:34Z Indexed on 2012/06/23 15:16 UTC
Read the original article Hit count: 224

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about sql