I have a mysql query to oreder by using difference of two fields of same table
SELECT *
FROM postings
ORDER BY vote_up - vote_down;
its working
How i write this query using propel criteria,
I write like this $crite开发者_StackOverflow中文版ria->addDescendingOrderByColumn(self::VOTE_UP-self::VOTE_DOWN)
but it makes errors. Anybody know please help.
Help is highly appreciated.
Thanks,
Try:
$criteria->addDescendingOrderByColumn(self::VOTE_UP.' - '.self::VOTE_DOWN)
精彩评论