我的表名是forum_posts
我将在子子ID
之后的第一个parent_id
获取数据
表示post_id
40
41
42
43
44
48(这里post_parent_id = 44)
49(这里post_parent_id = 44)
45
47(这里post_parent_id = 45)
46
50(这里post_parent_id = 46)
你可以帮助它如何实现
答案 0 :(得分:0)
类似的东西:
var result = list1
.Concat(list2
.Select(pair => new KeyValuePair<DateTime, int>(pair.Key, -pair.Value)))
.GroupBy(pair => pair.Key,
pair => pair.Value)
.Select(chunk => new KeyValuePair<DateTime, int>(chunk.Key, chunk.Sum()))
.OrderBy(pair => pair.Key);