HAVING without GROUP BY
I think your problem here is that by NOT specifying a GROUP BY clause ALL records are grouped into one group, so if the total of all your records sums up to more than 10 and you then filter out that one record with the HAVING clause you don't get a result.
If you reduced your records so that the sum of them adds up to less than 10 or change the figure to say 10000000 or more if required then it will work.
HTH.
|