title: how to use same column names with different data types in subquery in sqlserver
body: <p>I have a query:</p>
  
  <pre><code>select * 
  from proformaentry 
  where cast(tcmno as varchar) not in(
      select tcmno from contreceipt
  )
  </code></pre>
  
  <p>I want to list all <code>tcmno</code> from <code>proformaentry</code> table which is not in the table <code>contreceipt</code>. In <code>proformaentry</code> table, <code>tcmno</code> is <code>int</code> datatype but in <code>contreceipt</code>, it is <code>varchar</code> type. So I used above query, but it is not returning any rows.</p>
  
  <p>Actually there are some <code>tcmno</code> in <code>proformaentry</code> table which is not present in <code>contreceipt</code>.</p>
  
  <p>Hope I can get the correct query to retrieve the rows from here.</p>