Is it possible to do the following pseudo-code in Postgres 8+ or generic SQL?
SELECT table1.a, table1.b ... table1.x, (IF table1.x > table1.y RETURN table1.y ELSE return table1.x AS table1.y), table1.z...
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.
LEASTis a good solution in this case, but the more generic conversion would be theCASEstatement