I have two integer fields A and B in table T .
I want to do something like “SELECT * FROM T ORDER BY f(A,B) DESC“
where f(A,B) is a linear combination of A and B … i.e f(A,B) = mA + nB, where m and n are numbers.
What is the right syntax?
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.
You have two options (at least):
Or:
One or the other – possibly both – should work for you in MySQL. The first should work even if the second does not.