 <p>I have no idea what the question in there is, but I'll offer:</p> <pre><code>where ( param1 is not NULL or param2 is not NULL ) and ( ( ( col1 like param1 ) or param1 is NULL ) or ( ( col2 like param2 ) or param2 is NULL ) ) </code></pre>