【发布时间】:2020-01-08 18:06:13
【问题描述】:
ID UserName BookType BookID
1 Krish 1 1
1 Krish 1 2
1 Krish 2 1
1 Krish 2 2
2 Ram 1 1
3 Raj 1 1
3 Raj 1 2
我有上表,我想为每个用户获取不同的 BookType 计数和 BookID 计数,我可以在 SQL Server 中编写它,但是当我使用 LINQ 时,我无法编写查询。
我需要以下输出
ID UserName BookType BookID
1 Krish 2 2
2 Ram 1 1
3 Raj 1 2
【问题讨论】:
-
请解释你的输出。或展示您迄今为止尝试过的内容。
标签: c# sql-server linq linq-to-sql