SQL Selecting non-null rows conditionally
<p>I have a table like the below on teradata. </p>

<p>Each customer can have a max of 2 rows in the table - one with the address populated and one with address as null. So some customers can have only one row with an address. Some can have only one row with no address. Some can have 2 rows, one with address and one without address. </p>

<p>I want an output table with one row per customer - if there is an address, then I want that row, if not I want the null row. I've tried playing with case statements and where statements but I can't seem to get them to work. Seems like I need something like a max function for text.</p>

<p><strong>Table 1</strong>:    </p>

<pre><code>cust_id     address
1           abc
1   
2   
3           xyz
</code></pre>

<p><strong>Output</strong>: </p>

<pre><code>cust_id      address
1            abc
2   
3            xyz
</code></pre>