DECODE syntax:
DECODE (
value
, first_search , first_result
, second_search , second_result
, ... , ...
, default
)
The value parameter is compared with the search parameters and, when the first match is found, a respective result parameter is returned. If there is no match, the default parameter is returned.
DECODE(BONUS_FLAG,PREV_BONUS_FLAG,1,0) = 0
means that the BONUS_FLAG
and PREV_BONUS_FLAG
are not equal.
The entire expression flags a row for UPDATE
when PREV_ITEM_KEY
is not NULL and any of the attributes BONUS_FLAG, DISCOUNT or PRICE
has changed (previous value versus current value).