Frederick Cheung wrote: > On Dec 10, 5:36�am, Jay Mark <[EMAIL PROTECTED]> wrote: >> Rails? >> Is subselect not supported in Rails? >> > > For the sake of argument you can do > > @books = Books.find_by_sql ["SELECT * FROM books WHERE title IN > (SELECT > title FROM authors WHERE name = ?)", params[:author][:name]] > > But really whenever you use find_by_sql you should give yourself a > long hard look in the mirror. There's almost always a better way. > > Fred
Thanks a lot Fred. It works perfect now. Thanks for your help guys. Cypray -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

