sql语句查询匹配数组怎么写

str=split(str,"|")str是一个数组怎么从数据库中查询id=数组的行
2025-05-13 21:03:57
推荐回答(2个)
回答(1):

伪代码
str = "1|2|3|4"

str = str.Replace("|", ",");

string sql = "select * FROM T where [abc] in (" + str + ")";

就是select * from t where abc in (1,2,3,4)

回答(2):

select * from database_table where id=array_value