MySQL Math Order

I want to order the result of fieldx * fieldy , for example:

Line 1: fieldx = 10 fieldy = 10 Total: 100

Line 2: fieldx = 11 fieldy = 5 Total: 55

Line 1 should appear first. Could not find anything about it. This is for the codeIgniter project, so if there is a solution, I am very happy.

Thanks!

+6
math php mysql codeigniter
source share
1 answer

It is good to do the math in order:

select * from YourTable order by fieldx * fieldy 
+9
source share

All Articles