piniyini
Apr 5th 2006, 5:41 am
UPDATE: Problem Solved! Simply did
SELECT *
FROM `table`
ORDER BY `points` DESC , `gd` DESC
LIMIT 0 , 30
I'm trying to make a premiership league table for a football site and ran into a bit of difficulty. My php sql code looks like this
$sql_1 = "SELECT * FROM `premiershiptable` ORDER BY `points` DESC";
This works ok for the time being but I also need it to take into consideration the goal difference just incase some teams have the same points. Basically I need some code to say this
select * from table order by points desc and then by goal difference descending
Anyone? :)
SELECT *
FROM `table`
ORDER BY `points` DESC , `gd` DESC
LIMIT 0 , 30
I'm trying to make a premiership league table for a football site and ran into a bit of difficulty. My php sql code looks like this
$sql_1 = "SELECT * FROM `premiershiptable` ORDER BY `points` DESC";
This works ok for the time being but I also need it to take into consideration the goal difference just incase some teams have the same points. Basically I need some code to say this
select * from table order by points desc and then by goal difference descending
Anyone? :)