我需要在常规 sql 查询命令中构造一个这样的 linq:
select t1.vendorcode, t1.location, sum(t1.sales)
from table1 t1
where t1(vendorCode, location) in
(select t2.vendorCode, t2.location from table2 t2)
groupby t1.vendorCode, t1.location
我构造linq如下:
query = from t1 in table1
where ...
join t2 in table2 on new
{
t2.vendorcode, t2.location
} equals new
{
t1.vendorcode, t1.location
}
我的问题是:我应该如何构建这个 linq?我需要另一个子查询还是可以添加更多group by
并选择语句来完成这个 linq?