SQL Find duplicates
<p>I have a table (<strong>mytable</strong>) that I need to find the <strong>master_id</strong> that has both null and not null values in the <strong>value_id</strong> column</p>

<pre><code>master_id  value_id
1          1
1          2
1          1
2          1
2          null
3          null
3          null 
</code></pre>

<p>In the above example I need to <strong>fetch</strong> the master_id = 2 because it <strong>contains</strong> <strong>both</strong> null and not null value_id. master_id = 1 is OK</p>

<p>How can I achieve this? I am using SQL Server 2005/2008R2</p>

<p>Thanx</p>