Returning a default value when query does not return rows in DB2
<p>For a query I am using, a default value will need to be returned if no rows are returned (since the output will be used downstream).  The problem I'm encountering is how to programmatically identify that zero or null rows are returned so that the query knows to use the 'default' value.</p>

<pre><code>SELECT DISTINCT fieldName from DB2Table
WHERE qualifier1 = '___'
AND qualifier2 = '___';
</code></pre>

<p>This can return either a value or nothing (as in, no rows at all). I've attempted using count(*), NOT NULL, and EXISTS() within a CASE Statement, but I've had no luck.</p>

<pre><code>**Psuedocode**:
IF query returns values, return those
ELSE return "Some Value"
</code></pre>

<p>Any tips/insights would be greatly appreciated!</p>