Reported By: Robert Wachtel Reported On: 7/9/2002 For: Version 3.11 Build 1
# 1153Single-Row Aggregate SELECT Queries Not Working Properly with Expressions Inside of Functions Given is a table "Payments" with one field Payment (BCD). This table just holds two rows: 100 and 50.
select sum(Payment) from Payments
gives the correct result of 150 in one row.
But if I try
select sum(if(Payment > 50 then (-Payment) else (Payment))) from Payments
I don't get a sum anymore - I get two rows (-100 and 50).
ResolutionFixed Problem on 7/10/2002 in version 3.12 build 1