query across many-to-many

37 views
Skip to first unread message

Brian Craft

unread,
Apr 15, 2013, 4:47:22 PM4/15/13
to sqlk...@googlegroups.com
How do you do a query across a many-to-many relationship? E.g. if you have

(defentity pizza (many-to-many toppings))
(defentity toppings (many-to-many pizza))

and you want all the toppings for pizza #12, something like
(select toppings (where { :pizza.id 12}))

This generates sql like
"select toppings.* from toppings where pizza.id = 12"

which doesn't work, obviously.
Reply all
Reply to author
Forward
0 new messages