[英]How to make multiple aggregations with slick without group by
也許有人告訴我如何group by
使用平滑方法來聚合多個列而無需group by
。 我需要類似此示例的內容(不起作用)
val q = for {
d <- documents
dr <- documentRecords
if d.accountMonthId inSetBind monthIds
if d.documentType inSetBind DocumentType.currentDocuments
if dr.documentId === d.id
if dr.accountId === accountId
} yield (dr.map(dr => dr.debit,dr.credit).sum)
q.first
sql查詢應如下所示:
select sum(debit), sum(credit) from document join document_record where blahblahbalh
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.