ID Vote_Up Vote_Down ***DIFFERENCE***
1 3 1 2
2 1 3 -2
3 23 7 16
4 5 1 4
5 7 5 2
6 2 2 0
7 9 1 8
How do i sort the data above in mysql based on the difference of Vote_Up and Vote_Down Without having to create another column to store their difference?
vote_up - vote_down
So that it will be sorted this way:
ID Vote_Up Vote_Down ***DIFFERENCE***
3 23 7 16
7 9 1 8
4 5 1 4
5 7 5 2
1 3 1 2
6 2 2 0
2 1 3 -2
@Konerak:
DIFFERENCE is not a field.
Use this SQL query:
or