Context: The second (select type )input gets filtered based on the first input, but if the first left blank (empty|null|undefined) then no filter for the second input should work.
So
Code: Select all
WHERE
((rblocks.kompleks = '#KOMPLEKS#'))
Code: Select all
WHERE
((rblocks.kompleks = '#KOMPLEKS#'))
Code: Select all
WHERE (
IFNULL('#KOMPLEKS#','') = ''
OR LEFT('#KOMPLEKS#',1) = '#'
OR rblocks.kompleks = '#KOMPLEKS#'
)
IFNULL('#KOMPLEKS#','') = ''
#KOMPLEKS#
is NULL
or empty, the condition is true.LEFT('#KOMPLEKS#',1) = '#'
#KOMPLEKS#
is #
, the condition is true.rblocks.kompleks = '#KOMPLEKS#'
#KOMPLEKS#
contains a valid value, only rows where rblocks.kompleks
matches it will be returned.