Select tblppmp.idn
,tblppmp.total_item as a_total
,tblRequest.Quantity as b_total
,tblppmp.total_item - tblRequest.Quantity as itemsleft
FROM ppmp.dbo.tblppmp
INNER JOIN
(SELECT
tblrequest.idn
,sum(tblRequest.Quantity) AS Quantity
FROM ppmp.dbo.tblrequest
WHERE tblrequest.dr_year = 2015
GROUP BY tblrequest.idn) tblrequest ON tblppmp.idn = tblrequest.idn
上面如何來創建存儲過程是我的代碼,如何創建存儲過程和dr_year可能改變的值取決於由user..sample選擇的文本框或組合框,其中tblrequest。 dr_year =「Textbox1.text」在SQL Server 2008
在哪裏文本框?這是一個VB應用程序,ASP.NET? – Ryan
Vb sir .. visual basic 2008 –
sir?你在嗎? LINQ SIR中的 –