存储过程,多条件删除
Create Proc Proc_DeleteBaseData1(
@txtone varchar(50),
@txttwo varchar(50),
@txtcontion varchar(50),
@outprint varchar(50) output)
as
begin
if @txtcontion='全部'
delete from 基础数据 where 日期 between @txtone and @txttwo
else
delete from 基础数据 where 车队 in (@txtcontion) and 日期 between @txtone and @txttwo
END
SET @outprint='删除成功'
影响行数为0
其中@txtcontion有可能是选择的多个车队,1车队,2车队,3车队,或者只是一个车队,例如1车队.
不知道如何解决,谢谢
@txtone varchar(50),
@txttwo varchar(50),
@txtcontion varchar(50),
@outprint varchar(50) output)
as
begin
if @txtcontion='全部'
delete from 基础数据 where 日期 between @txtone and @txttwo
else
delete from 基础数据 where 车队 in (@txtcontion) and 日期 between @txtone and @txttwo
END
SET @outprint='删除成功'
影响行数为0
其中@txtcontion有可能是选择的多个车队,1车队,2车队,3车队,或者只是一个车队,例如1车队.
不知道如何解决,谢谢
...全文
相关推荐
c#多条件查询存储过程实例
在多个条件下查询数据表文件,利用存储过程灵活组织查询条件
sqlserver 存储过程分页(按多条件排序)
sqlserver 存储过程分页,并支持条件排序,需要的朋友可以参考下。
GBase 8S 自定义存储过程和函数.doc
存储过程(Stored Procedure)是一组已经事先编译好,能够完成特定功能的SQL语句集合,是一个独立的数据库对象。存储过程类似于高级语言中的函数,可被用户的应用程序调用,执行。不同的是,存储过程经过编译后存放在服务器端,这为开发C/S和B/S应用程序提供了强有力的支持。由于存储过程是已经编译好的代码,所以执行时不必再次进行编译,从而提高了程序的执行效率。
根据多条件查询临时表 想得到不同结果集的方法
当我写下如下sql语句时,我得到了输入@c参数时想得到的结果集。select * from @tb t where t.id in (select id from tb where f = @c) 但如果有@a,@b,@c,而它们分别想从@tb中得到不同的结果集,例如 代码如下: if @a is not null begin –得到@a想得到的 end if @b is not null begin –得到@b想得到的 end if @c is not null begin –得到@c想得到的 end 这样做好像没什么问题,但如果@a和@b是一起的,甚至是@a,@b,@c,@d,@e,@
mybatis常用语句和lyaui 多条件查询加分页
这是一个 常用的 后端增删改查的通用 mybatis的文件 适用于大学生的毕业设计和一般的项目的CRUD都可以


应用实例
