我想将以下SQL查询转换为linq。
这就是我要转换的东西
from BeautifulSoup import BeautifulSoup
import urllib2
url= 'http://www.awgp.org/about_us'
openurl=urllib2.urlopen(url)
soup = BeautifulSoup(openurl.read())
for a in soup.findAll('a'):
print (a.text, a.get('href'))
我尝试过这样,但我不知道如何在此linq中获取子查询
SELECT IH.ID, IH.InvNo, IH.PaymentStatus, SUM(TotalAmount) -
(SELECT SUM(Amount) FROM Student WHERE InvNo=bh.InvNo) AS CollectableAmount
FROM InvoiceHeader AS IH
INNER JOIN InvoiceDetail AS ID ON IH.ID=BD.BillId
WHERE IH.StudentID=0103 AND IH.PaymentStatus<>1
GROUP BY IH.ID, IH.InvNo, IH.PaymentStatus
它表示from无效,
from ih in InvoiceHeaders
join bd in InvoiceDetails on ih.ID equals id.BillId
where bh.StudentID = 0103 && bh.PaymentStatus != 1
select new { ID = ih.ID, BillNumber = ih.BillNumber, PaymentStatus = ih.PaymentStatus })