SQL WHERE statement optional
Posted: Thu Aug 21, 2025 2:01 pm
Hi people! Probably this is a beginner level question but i couldn't make the WHERE statement optional.
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 clause somehow doesn't make it really optional and filter's working anyway, whereas i need WHERE eliminated if '#KOMPLEKS#' equals null and all records should show up
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#'))