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