0
我寫一個存儲過程是這樣的:SQL Server 2005的存儲過程的問題
create PROC uspInvCustomerLineItemGetList1(@CustomerID varchar(50))
AS
BEGIN
SELECT LineItemID, LineItemName
from tblInvoiceLineItems
where CustomerID = @CustomerID
or CustomerID = ''
and AccountNumber = (select AccountNumber from tblInvAccountDetails
where AccountTypeID = 10 and 20)
END
我的問題是通過2個或多個值(select AccountNumber from tblInvAccountDetails where AccountTypeID = 10 and 20)
所以我會比較子查詢都accountnumbers (1000, 10003, 1006)
基於AccountTypeID = 10 and 20
如何我可以寫存儲過程嗎?
謝謝
hemanth
歡迎StackOverflow上在左右檢查。請注意常見問題解答:http://meta.stackexchange.com/q/7237/27535 – gbn