I am looking at a cursor
with decode(1, 1, 1, NULL, 0)
in the SELECT
statement. The query returns records of employees that have worked for 5 years or more. I assume that the intention of the decode statement was to check if a record is returned or not (meaning that said employee has worked for five or more years).
This approach doesn't seem to work. It could be because I am simply putting in the wrong dummy data. Is my assumption correct(that this approach doesn't work)? If I am incorrect, how does this decode statement accomplish the goal of identifying if a record is returned?
CURSOR worked_more_then_five_years
IS
SELECT decode(1, 1, 1, NULL, 0)
FROM table
WHERE /*query conditions*/