比如我一个sql语句里面好十几个条件,一次性把sql执行完后出来的结果是都符合条件的
但是日志那里又必须为哪些条件没符合做个记录
不知道能不能实现的?总不可能事后在一个个条件去反查,十几个太恐怖了
希望知道的给我个思路谢谢
------解决方案--------------------
------解决方案--------------------
- SQL code
;with cet as(select * from tb exceptselect * from tb where 条件1 and 条件2 and 条件3 and ...)select case when 条件1 then '' esle '条件1' end + case when 条件2 then '' esle '条件2' end +... as 缺少的条件 from cet