gpt4 book ai didi

SQL + IN + 参数

转载 作者:行者123 更新时间:2023-12-04 05:35:17 30 4
gpt4 key购买 nike

我有一个字符串作为参数传递给我的存储过程。

dim AgentString as String = " 'test1', 'test2', 'test3' "

我想在 IN 中使用该参数声明。
AND M.SalesRep IN (@AgentString)

但是,这似乎不起作用。提前感谢您的时间。

最佳答案

或者,您可以进行字符串比较。

dim AgentString as String = "test1,test2,test3"

然后有:
where ','+AgentString+',' like '%,'+M.SalesRep+',%'

我在所有内容之前和之后都加了逗号,所以“ed”与“edith”不匹配。

关于SQL + IN + 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12030938/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com