在VB中将SQL查询转换为LINQ查询

时间:2013-05-16 06:48:19

标签: asp.net vb.net linq linq-to-sql sql-to-linq-conversion

我想知道如何将下面列出的SQL查询转换为VB中的LINQ查询:

SELECT * FROM
    (SELECT SUM(t.Amt) Tax, g.GenQuoteDetails_Id, g.lastTkdt, g.QuoteDt, g.BaseFareCurrency, g.BaseFareAmt, g.BaseDecPos, g.LowestorNUCFare, g.EquivCurrency, g.EquivAmt, g.EquivDecPos,g.TotCurrency,g.TotAmt,g.TotDecPos,fareinfo_id FROM GenQuoteDetails g
     INNER JOIN TaxData t ON t.TaxDataAry_Id = g.GenQuoteDetails_Id
     GROUP BY  g.GenQuoteDetails_Id, g.lastTkdt, g.QuoteDt, g.BaseFareCurrency, g.BaseFareAmt, g.BaseDecPos, g.LowestorNUCFare, g.EquivCurrency, g.EquivAmt, g.EquivDecPos, g.TotCurrency, g.TotAmt, g.TotDecPos, fareinfo_id) a
INNER JOIN
    (SELECT p.PenFeeAry_Id, r.RsvnRules_Id, p.TkNonRef, fareinfo_id
     FROM PenFee p, RsvnRules R
     WHERE p.PenFeeAry_Id = r.RsvnRules_Id
     GROUP BY p.PenFeeAry_Id, r.RsvnRules_Id, p.TkNonRef,fareinfo_id) b
ON a.fareinfo_id = b.fareinfo_id

0 个答案:

没有答案