mam poniższych tabelach:Jak napisać ten krzyżyk zastosuj zapytanie w LINQ-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
)
chciałbym napisać następującą kwerendę w LINQ-SQL przy użyciu notacji lambda:
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
Jak to zrobić?