Outcome.find(:all, :conditions => 'outcomes.outcome_date = (select max(o2.outcome_date) from outcomes o2 where o2.testrun_id = outcomes.testrun_id and o2.testcase_id = outcomes.testcase_id)')
On Tue, Sep 23, 2008 at 9:31 AM, Brad Symons <[EMAIL PROTECTED]> wrote: > > i have a query, i need to transfer this using all the find conditions > etc, can anyone give me a few pointers? > > select * from outcomes o1 where o1.outcome_date = (select > max(o2.outcome_date) from outcomes o2 where o2.testrun_id = > o1.testrun_id and o2.testcase_id = o1.testcase_id); > > Outcome.count ?? > -- > Posted via http://www.ruby-forum.com/. > > > > -- Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) João Pessoa, PB, +55 83 8867-7208 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

