SQL Statement whether Entry exists
<p>i want to select a 1 when a special entry exists in one of my tables, otherwise a 0.</p>

<p>I thought of doing it like this:</p>

<pre><code>SELECT 1 FROM dual ..... 
</code></pre>

<p>In PLSQL it would be like this:</p>

<pre><code>SELECT CASE 
        WHEN EXISTS (
                SELECT 1
                FROM * TABLE *
                WHERE * requirements *
                )
            THEN 1
        ELSE 0
        END
INTO * variable *
FROM dual;
</code></pre>

<p>But I have no idea how to implement something like this in normal SQL.</p>

<p>I just want to get a 1 if the entry exists and otherwise a 0 (null would be also okay I guess).</p>