2010-03-19 58 views
0

請幫助我。我可以如何將這個SQL查詢翻譯成LINQ請求?將查詢從原生SQL轉換爲LINQ請求

SELECT TOP (1) PERCENT DATEDIFF(DAY, dbo.PO.ORDER_DATE, GETDATE()) AS Age 
       FROM dbo.ITEMS INNER JOIN 
             dbo.X_PO ON dbo.ITEMS.ITEMNO = dbo.X_PO.ITEM_CODE INNER JOIN 
             dbo.PO ON dbo.X_PO.ORDER_NO = dbo.PO.DOC_NO AND dbo.X_PO.STATUS = dbo.PO.STATUS 
       WHERE  (dbo.ITEMS.ITEMNO = 'MBIN001') AND (dbo.X_PO.STATUS = 3) 
       ORDER BY Age 

回答