【发布时间】:2013-12-18 08:09:58
【问题描述】:
我需要计算 table1 中的记录,但条件是
我不应该计算 table1 中外键存在于 table2 中的记录。
我只想要 table1 中不在 table2 中的记录数
我想做的是c#-linq。
假设我有这张桌子
ID Text userId
-- ---- ------
1 hi! this is me 5
2 hey 5
3 no no 5
还有第二张桌子
pkid fkId
---- ----
5 1
6 1
7 1
我想要 table1 中 userId=5 的所有记录,但不想要 table2 中外键为 table1 的记录
【问题讨论】:
-
你能证明你想用 Linq 做这个吗?
标签: c# .net sql-server asp.net-mvc linq