.net 拼接sql语句 in('xxx','xxx')
2011-09-07 15:26
387 查看
要求传递过来的字符串格式为:xxxx,xxx,xxxxx,xxxx,(两边可以有逗号).
string.Format("delete table1 where id in ('{0}')", ids.Trim(',').Replace(",", "','"));
相关文章推荐
- 移动文章分类的sql语句,查询并更新同一个表的方法 You can't specify target table 'news_articles' for update in FROM clause
- ADO.NET Entity Framework: The version of SQL Server in use does not support datatype 'datetime2'
- Yii报错:SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id' in order clause is ambiguous
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- 【xcode】错误之Certificate identity 'iPhone Developer: XXX' appears more than once in the keychain
- java.sql.SQLException: Unknown type '246 in column 0 of 1 in binary-encoded result set的解决办法
- INSERT 语句与 FOREIGN KEY 约束"XXX"冲突。该冲突发生于数据库"XXX",表"XXX", column 'XXX。
- ASP.NET偷懒大法三 (利用Attribute特性简化多查询条件拼接sql语句的麻烦)
- Mybatis-异常-There is no getter for property named 'VARCHAR' in 'class com.xxx.xxxxx
- Dynamic 'Sales by Week' Procedure in SQL Server
- (解决办法)ASP.NET导出Excel,打开时提示“您尝试打开文件'XXX.xls'的格式与文件扩展名指定文件不一致
- sql语句 自己编写一个函数reversion,完成颠倒一个字符串,即:select dbo.reversion('abcd') 输出的结果为 dcba
- SQL语句中引号(')、quotedstr()、('')、format()在SQL语句中的用法
- hive java.sql.SQLException: Table/View 'PARTITION_STATS_V2' already exists in Schema 'APP'.
- There are inconsistent line endings in the 'xxx' script. Some are Mac OS X (UNIX) and some are Windows
- 关于在使用spring出现类似java.sql.SQLException: Access denied for user 'XXX'@'localhost' (using password: YES)
- asp.net后台对sql语句排序,筛选,gridview隐藏过长的字符串鼠标放上去显示全部,dropdownlist在前台显示拼接字符串
- How to troubleshoot 'Procedure or function has too many arguments specified' in asp.net 2.0
- No configuration found for the specified action: 'xxx/xxx.action' in namespace: ''. Form action def
- 【mysql】【报错】Mysql外键名重复的错误:duplicate key in table '#sql-*'