Lets say i have a table that has the following field names
'id' 'likes' 'rating' 'view'
A normal MySQL sort would require a simple
SELECT * FROM $table ORDER BY likes DESC, rating DESC, view DESC
Now lets say I would want to order the given entries in my table by an arbitrary function
function custom_sort(likes, rating, view) {
fame = 0.5 * like + 0.25 * rating - view;
return fame;
}
I want to know if it is possible to do this pseudo code like action
SELECT * FROM $table ORDER BY custom_sort(likes, rating, view) DESC
0.5 * like + 0.25 * rating - view) in ORDER BY clause.