[英]Passing numbers array to stored procedure
有沒有一種方法可以將數字數組傳遞給存儲過程以供IN運算符使用? 我有類似的東西
SELECT * FROM table WHERE col IN (1,2,3);
我想將(1,2,3)
作為參數傳遞。 這可能嗎?
你可以這樣嘗試
create procedure test (@input1 integer(2) in,@input2 integer(2) in,@input3 integer(2) in)
as
select * from table where col in (@input1,@input2,@input3);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.