I would like to do the following:
SELECT sum(max(field-10,000,0)) from TABLE
as in, I want to have field-10,000 summed up, but if field-10,000 < 0 then I want it to add 0.
any suggestions?
Karl
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ANSIsyntax (supported bySQL Server,Oracle,MySQLandPostgreSQL):Using
GREATEST(not supported bySQL Server):