asp 数据库删除数据
显示语法错误id=Trim(Request.Form("id"))sql="deletefrom安装where业务编号like'"&id&"'and当前状态='"&安装施...
显示语法错误
id=Trim(Request.Form("id"))
sql = "delete from 安装 where 业务编号 like '"&id&"' and 当前状态 = '"&安装施工&"'"
rs.open sql,conn,1,3
response.write "<script>alert('删除成功');location.href='wazx.asp';</script>"
sqlconn.close
set sqlconn = nothing
改成这样还是不能删除
sql ="delete from [安装] where [业务编号] = "&id&" and [当前状态]='安装施工'" 展开
id=Trim(Request.Form("id"))
sql = "delete from 安装 where 业务编号 like '"&id&"' and 当前状态 = '"&安装施工&"'"
rs.open sql,conn,1,3
response.write "<script>alert('删除成功');location.href='wazx.asp';</script>"
sqlconn.close
set sqlconn = nothing
改成这样还是不能删除
sql ="delete from [安装] where [业务编号] = "&id&" and [当前状态]='安装施工'" 展开
3个回答
展开全部
sql ="delete from [安装] where [业务编号] like '*"&id&"*' and [当前状态]='安装施工'"
或者
sql ="delete from [安装] where instr([业务编号],'"&id&"')>0 and [当前状态]='安装施工'"
或者
sql ="delete from [安装] where instr([业务编号],'"&id&"')>0 and [当前状态]='安装施工'"
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
delete from xinghao where id not in ( select max(id) from xinghao group by xinghao ) -- 找到重复的xinghao内容的记录,并且删除之前出现的相同内容的记录,留下最后一次相同记录的内容
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询