Try adding it as a field in your find, then sorting by the field
alias:

SELECT [...], ((thread.views*0.1)+*(thread.messages*0.8)) AS something
FROM [...] ORDER BY something DESC

On Apr 18, 7:28 am, hks <[EMAIL PROTECTED]> wrote:
> In my query, I want to use  'order' => "( (thread.views * 0.1) +
> (thread.messages * 0.8) ) DESC"
>
> But cakephp will escape the fields and turn the number 0.1 into
> `0`.`1` causing error in SQL.
> I tried using the -! but it doesn't work.
>
> Any suggestions?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to