このSQLクエリをL2Sに変換しようとしています..
SELECT TOP 5 vt.*
FROM dbo.ADTEXP_RateDefinitions vt
JOIN
(SELECT vLocationID FROM dbo.Vessel_Table WHERE iOwner=401) V
ON vt.VesselID=V.vLocationID
ORDER BY vt.RateAddedDate DESC
どんな助けや提案もありがとう
このSQLクエリをL2Sに変換しようとしています..
SELECT TOP 5 vt.*
FROM dbo.ADTEXP_RateDefinitions vt
JOIN
(SELECT vLocationID FROM dbo.Vessel_Table WHERE iOwner=401) V
ON vt.VesselID=V.vLocationID
ORDER BY vt.RateAddedDate DESC
どんな助けや提案もありがとう
これを試して。
var result = (from vt in dbo.ADTEXP_RateDefinitions
join V in (
(from VT1 in dbo.Vessel_Table
where
VT1.iOwner==401
select new {
VT1.vLocationID
})) on vt.VesselID equals V.vLocationID
orderby
vt.RateAddedDate descending
select vt).Take(5)
(from vrt in _db.ADTEXP_RateDefinitions
join vt in _db.Vessel_table
on vrt.VesselId equals vt.locationId
where vt.iOwner == 401
select new
{
VesselId = vrt.VesselId,
Owner = vt.iOwner
}).Take(5)
私はそれのように思う:
(from vt in dbo.ADTEXP_RateDefinitions
from v in (from vlt on dbo.Vessel_Table where vlt.iOwner=401 select vlt)
where vt.VesselID = v.vLocationID
orderby vt.RateAddedDate descending
select vt).Take(5);