CURSOR c
IS
SELECT COMPANYID,
GROUPID,
PERIODID,
FN_PPROCESSCURRENT
FROM LIQUIDATIONSDETAILS
WHERE PROCESSID = FN_PPROCESSPREVIOUS
AND (UNCOLLECTED > 0 OR INVOICE = 0)
AND (((GROUPID = vgroupid) AND (vgroupid > -1)) OR (vgroupid = -1))
उदाहरण के लिए:यदि vgroupid = -1
, तो अंतिम शर्त होगी (((GROUPID = -1) AND (-1 > -1)) OR (-1 = -1))
या ((forever_false AND forever_false) OR (forever_true))
या (-1 = -1)
- सभी रिकॉर्ड
इसके बजाय, अगर vgroupid = 123
अंतिम शर्त होगी (((GROUPID = 123) AND (123 > -1)) OR (123 = -1))
या (((GROUPID = 123) and forever_true) OR (forever_false))
या (GROUPID = 123)
- केवल 123 ग्रुपिड