通常の 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 を完成させることはできますか?