MySQL Forums
Forum List  »  Newbie

QUERY HELP
Posted by: Omolewa Stephen
Date: December 21, 2016 11:28AM

Good day.
I want to retrieve rows of a database table where there is a column for amount and i want to retrieve the sum of the amount column using SUM function AND WHERE CLAUSE and also retrieve the rows affected for the SUM function.

For example:
SELECT user_id,amount FROM table WHERE SUM(amount) = 5000.
but this is not working and i am getting the affected rows for the sum.

Thanks

Options: ReplyQuote


Subject
Written By
Posted
QUERY HELP
December 21, 2016 11:28AM
December 21, 2016 11:55AM
December 21, 2016 12:06PM
December 21, 2016 01:55PM
December 21, 2016 03:39PM
December 21, 2016 12:53PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.