sqlite里面支持像sqlserver的like的用法吗?
程序员文章站
2022-06-10 16:15:01
...
string sql = Select Count(ID) As rcount From tbArticle WHERE classID IN( + ids + ) AND Title LIKE @Title ; 参数: SQLiteParameter[] sps = new SQLiteParameter[1]; sps[0] = SQLite.CreateParameter(@Title, DbType.String, % + title + %, 50, Par
string sql = “Select Count(ID) As rcount From tbArticle WHERE classID IN(” + ids + “) AND Title LIKE @Title “;
参数:
SQLiteParameter[] sps = new SQLiteParameter[1];
sps[0] = SQLite.CreateParameter(“@Title”, DbType.String, “%” + title + “%”, 50, ParameterDirection.Input);
就是在变量里直接模拟成 ‘%test%’ ,把这个传递进去,就可以查出结果了
上一篇: sql profile简介