1

この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 

どんな助けや提案もありがとう

4

3 に答える 3

1

これを試して。

  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)
于 2012-06-29T07:15:15.897 に答える
0
(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)
于 2012-06-29T07:00:42.667 に答える
0

私はそれのように思う:

(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);
于 2012-06-29T07:14:57.267 に答える