Subject | Stored Procedure |
---|---|
Author | Robert F. Tulloch |
Post date | 2000-11-01T01:17:14Z |
Hi:
I am running below statement, iterating through each month 1-12.
SELECT ASSOCID,
((SELECT COUNT (A1.ASSOCID)
FROM ASSOC_C A1
WHERE (A1.INITL_DATE <= :CutDate)) -
(SELECT COUNT (A2.ASSOCID)
FROM ASSOC_C A2
WHERE (A2.CANCL_DATE < :CutDate))) AS NetMembers
FROM ASSOC_C A0
WHERE A0.ASSOCID = :CONTROLID AND A0.ID = :ID;
Would there be any advantage to put this into a stored procedure
and call it 12 times to get the same data?
Thanks.
Best regards
I am running below statement, iterating through each month 1-12.
SELECT ASSOCID,
((SELECT COUNT (A1.ASSOCID)
FROM ASSOC_C A1
WHERE (A1.INITL_DATE <= :CutDate)) -
(SELECT COUNT (A2.ASSOCID)
FROM ASSOC_C A2
WHERE (A2.CANCL_DATE < :CutDate))) AS NetMembers
FROM ASSOC_C A0
WHERE A0.ASSOCID = :CONTROLID AND A0.ID = :ID;
Would there be any advantage to put this into a stored procedure
and call it 12 times to get the same data?
Thanks.
Best regards