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))
bijvoorbeeld:if vgroupid = -1
, dan is de laatste voorwaarde (((GROUPID = -1) AND (-1 > -1)) OR (-1 = -1))
of ((forever_false AND forever_false) OR (forever_true))
of (-1 = -1)
- alle records
in plaats daarvan, als vgroupid = 123
laatste voorwaarde is (((GROUPID = 123) AND (123 > -1)) OR (123 = -1))
of (((GROUPID = 123) and forever_true) OR (forever_false))
of (GROUPID = 123)
- slechts 123 GROUPID