I have a problem . I want arrange order decrease of column. iphone4 ,iphone5, iphone6. For example:
Name |iphone4 |iphone5|iphone6
john | 6 | 7 | 8
Smith| 6 | 9 | 8
Louis| 6 | 7 | 10
Nick | 7 | 7 | 8
john | 2 | 7 | 4
Smith| 7 | 7 | 5
this is my mysql
Select Name, SUM(iphone4) ,SUM(iphone5),SUM(iphone6) from orders group by Name order by iphone4 DESC, iphone5 DESC, iphone6 DESC
but it's only working column iphone4 and iphone5. the rest, iphone6 it's don't working Who can help me?