Oracle sql - display if record exists else display parent
<p>I want to categorize data into two types based on: </p>

<p>If a value exists in T2, display "A", else display "B" as "Type". Is there a way to implement this in case when or decode? </p>

<p>T1 is the parent of T2.</p>

<pre><code>T1 
1
2
3
4
5

T2
1
1
3
3
3
4
</code></pre>

<p>Ideally my output would be</p>

<pre><code>Type
A
B
A
A
B
</code></pre>

<p>edit: I want to add that A and B are text values I want to display based on my above condition, this is not coming from the db. Also, T2 will not have a corresponding record at all for 2 &amp; 5. so I cannot really check for null.</p>