以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  请教一个sql语句  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=142732)

--  作者:xxfoxtable
--  发布时间:2019/11/4 20:49:00
--  请教一个sql语句
s elect * from {表A}  where 字段 in (字符串)
这样的语句,正确写法是怎么样的?是决对的相等,字符串中是用逗号分开的,不是模糊查询的在里面,字符串是一个字符串变量
[此贴子已经被作者于2019/11/4 20:50:15编辑过]

--  作者:有点蓝
--  发布时间:2019/11/4 20:58:00
--  
dim 字符串 as string = "A,B,C"
dm sql as string = "s elect * from {表A}  where 字段 in (\'" & 字符串.replace(",","\',\'") & "\')"