Mike Kurdziel
2006-Sep-02 21:19 UTC
select from one table where id isn''t in another table
I have two tables table1 id title table2 id table1_id how can I find all items in the first table that don''t have their "table1_id" in the second table? In SQL I would do something like "select from table1 where id not in (select table1_id from table2)" Is there an easy way to do this in ruby? Thanks in advance! -Mike -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---