Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
伙计们:
假设我有一个记录元组的基表。如果用户想要得到满足某些条件的 count(*),可以使用如下 SQL 查询:
SELECT count(*) FROM table where cond1=$cond1 AND cond2 = $cond2 AND...
问题1:如果条件保持不变,我们如何获得实时计数?由于某种原因,我不能直接使用 count(*) 来完成任务。
问题2:如果出现新情况,如何扩展问题1中的情况?
尽管很难想象究竟是什么可以阻止您使用COUNT()一种可能的方式来实现您的目标(如果我正确理解您的要求)并假设可能的参数组合数量有限,但可能是:
COUNT()
更新您的触发器