【发布时间】:2018-12-08 03:02:35
【问题描述】:
我有三种情况,如果都满意就做点什么。
-
select count(*) from schema.member where condition1为 0 -
select id from schema.ta a, schema.b where a.id=b.id and a.id !='input_id' and a.id in ('M','N');它应该为 null 或不存在。 -
select member from schema.tc, x schema.tb where condition3;它也应该为 null 或不存在。
所以基本上如果所有3个场景都满足,那么我会做一些事情。
我想使用存储过程来完成它。我的想法是 从每个场景的计数总和中获取一个整数;如果为0,则全部满足。
点赞select count(id) from schema.member where condition1
+ select count(id) from ... where condition2
+ select count(member) from ... where condition3 = 0
不确定最好的方法是什么,感谢脚本帮助。
【问题讨论】:
-
你的问题很不清楚,涉及到几个表。您能发布示例数据和预期输出吗?
标签: sql oracle stored-procedures plsql