开发者

Order by difference between 2 columns of

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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜