Hi,
Any tips on how can I get all rows given the following example?
Table:
Instruments (contains instruments I own)
Records:
Piano
Guitar
Keyboard
Flute
Violen
Table:
Songs (a library of all my songs)
Records:
Paradise City (id 1)
Back In Black (id 2)
Table:
Instruments_In_Song (rows for each instrument in each song from above
table)
Guitar (song_id 1)
Keyboard (song_id 1)
Guitar (song_id 2)
Drums (song_id 2)
Forget about the accuracy of the actual example. What I want is to find
all songs that have instruments that I own. In the example above, the
query would include Paradise City since I have a guitar and a keyboard,
but would omit Back in Black since I have a guitar, but don''t have a
drum set.
Any pointers with ActiveRecord or general SQL would be helpful.
Thank you,
Michael
--
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?hl=en
-~----------~----~----~----~------~----~------~--~---