postgresql - Join multiple tables with aggregation in Squeryl -
i'm trying join card part , left join summed stock value part (some parts won't have stock row).
i have following thought work..
def stockperbase = from(stock)(s => groupby(s.base) compute(sum(s.quantity))) def allcardswithstock = join(cards, parts, stockperbase.leftouter)((c,p,s) => on(c.partid === p.id, p.base === s.map(_.key)) select(c, p, s.measures))
however following error:
too many arguments method on: (table: org.squeryl.table[a])(declarations: => seq[org.squeryl.dsl.ast.basecolumnattributeassignment])unit [error] on(c.partid === p.id, p.base === s.map(_.key))
any on how can such query apprecited.
the select
clause should come before on
in query. try reversing order of 2 clauses , should work.