为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。 【DM版本】:dm8 【操作系统】:windows 【CPU】: 【问题描述】*:在sqlserver中,通过IF EXISTS可以判断一个查询结果是否存在。 而我看DM文档中,IF EXISTS似乎只能判断存储过程名,请问我应该怎么实现判断查询结果?
可以采用赋值的方法,类似
declare v1 int; begin select count(*) into v1 from filelist where xxx; if v1 = 0 then 结果不存在; else 结果存在; end if; end;
可以采用赋值的方法,类似
declare v1 int; begin select count(*) into v1 from filelist where xxx; if v1 = 0 then 结果不存在; else 结果存在; end if; end;