1
を使用して、グループを選択します。ネストされたが、私はLINQの式に次のクエリを変換しようとしていますLINQ
SELECT t1.lastchanged,
currentstatus,
(SELECT count(ID)
FROM [Issues] t2
WHERE t2.CurrentStatus = t1.currentstatus and t2.lastchanged <= t1.lastchanged) AS running_total
FROM [Issues] t1
GROUP BY t1.lastchanged, currentstatus
ORDER BY t1.lastchanged
はこれまでのところ、私は次のことをやった:
var statusCounts = models.GroupBy(x => new { x.CurrentStatus, x.LastChanged })
.Select(g => new { g.Key, Count = g.Count() })
.ToList();
任意の提案ですか?
パーフェクト!これが私の必要なものです。ありがとう – Hanady
@ハナディ - あなたは非常に歓迎です:) –