[solved] math in the query
Posted: Fri May 28, 2004 7:34 am
I have an sql table with a bunch of fields and I only want to return a result if they sum to 0. this is what I have:
I know the math is working because i can just run the query and Total Lives is right. If I go 'Total Lives' = 0 it returns all results. I'm not exaclty sure whats going on here. Any ideas?
Code: Select all
SELECT report.A1 + report.B1 + report.C1 + report.A2 + report.B2 + report.C2 + report.A3 + report.B3 + report.C3 AS 'Total Lives'
FROM `report`
WHERE 'Total Lives' > 0