Jump to content

Order by sum


phpSensei

Recommended Posts

Hi,

 

Its been awhile since I have been coding in PHP, What I am trying to do is

 

SELECT field1, field2, field3 FROM table ORDER BY SUM(field1,field2,field3) LIMTI 5

 

I have 3 fields in my table, all 3 fields are ratings like 1.2/10, or 3.2/10, I want to order the table by the best ratings. SO I want it to order by the 3 columns... I was thinking of adding all 3 fields and then order by who has the best overall ratings..

 

Thankyou for any help.

Link to comment
https://forums.phpfreaks.com/topic/127882-order-by-sum/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.