where in ,当ID相同时只更新一个记录的问题
bh=Request.QueryString("bh")
set rs=server.CreateObject("adodb.recordset")
rs.open "select bh,sl FROM xs WHERE bh in ('" & bh & "') ",conn,1,3
rs("sl")=1
rs.update
rs.close
set rs=nothing
bh是传递过来的值,一次一个,对应表里面可能有多条记录。
想用where in 一次更新bh相同的相关字段,发现只能更新一条,一般这样的情况用什么方法。
相关推荐
mysql中You can’t specify target table for update in FROM clause错误解决方法
mysql中You can’t specify target table for update in FROM clause错误的意思是说,不能先select出同一表中的某些值,再update这个表(在同一语句中)。 例如下面这个sql: 代码如下: delete from tbl where id in ( select max(id) from tbl a where EXISTS ( select 1 from tbl b where a.tac=b.tac group by tac HAVING count(1)>1
Mybatis批量更新报错问题
主要介绍了Mybatis批量更新报错的问题及解决办法,包括mybatis批量更新的两种方式,需要的的朋友参考下
Linq to SQL Delete时遇到问题的解决方法
1.1、 Code1: using (PubsDataContext pubsContent = new PubsDataContext()) { pubsContent.Log = Console.Out; Author author = pubsContent.Authors.Single(a => a.au_id == “111-11-1111”); pubsContent.Authors.DeleteOnSubmit(author); pubsContent.SubmitChanges(); } 可是,马上我的程序支持到这
用触发器实现SQLite的外键约束
最近在做数码相框上的嵌入式开发,开发过程中使用的SQLite数据库,但是编码的过程中,遇到个问题,SQLite不支持外键约束,外键约束会被解析但不会被执行。
Mysql一些复杂的sql语句(查询与删除重复的行)
1.查找重复的行 SELECT * FROM blog_user_relation a WHERE (a.account_instance_id,a.follow_account_instance_id) IN (SELECT account_instance_id,follow_account_instance_id FROM blog_user_relation GROUP BY account_instance_id, follow_account_instance_id HAVING COUNT(*) > 1) 2.删除重复的行(保留一条) PS:因为mysql的delete,如果


