linq to sql 实现左外部连接:var query=from a in A join b in B on a.ID equals b.aID into ab from a1 in ab.DefaultIfEmpty() select a1;
然后取query.Count()就行了
因为是延迟查询所以不会多查数据
时间: 2024-12-18 22:34:39
linq to sql 实现左外部连接:var query=from a in A join b in B on a.ID equals b.aID into ab from a1 in ab.DefaultIfEmpty() select a1;
然后取query.Count()就行了
因为是延迟查询所以不会多查数据