14
私は、次の表があります。このクロスクエリをLINQ-to-SQLに書き込む方法を教えてください。
create table TableA (
Id int primary key identity,
Key int not null
)
create table TableB (
Id int primary key identity,
TableA_Id int not null foreign key references TableA(Id),
Value varchar(80) not null
)
を私はラムダ表記を使用してLINQツーSQLで次のクエリを記述したいと思います:
select TableA.Key, b.Value
from TableA
cross apply (
select top 10 TableB.Value
from TableB
where TableA.Id = TableB.TableA_Id
order by TableB.Value
) b
where TableA.Key between 0 and 999
は、私はこれをどのように行うのでしょうか?