title: Inserting unique value from another table
body: <p>Tables: I have 3 tables 
  They are cust, new_cust, old_cust
  all of them have 3 columns, they are id, username, name
  each of them have possibilities to have same data as the others. 
  I would like to make "whole" table that consisting all of them but only the uniques.</p>
  
  <h1>I've Tried</h1>
  
  <h2>Creating a dummy table</h2>
  
  <p>I've tried to create the dummy table called "Temp" table by </p>
  
  <pre><code>select * 
  into Temp 
  from cust
  </code></pre>
  
  <h2>insert all table to dummy</h2>
  
  <p>Then I insert all of them into they Temp table</p>
  
  <pre><code>insert into temp
  select * from new_cust
  
  insert into temp
  select * from old_cust
  </code></pre>
  
  <h2>taking uniques using distinct</h2>
  
  <p>After they all merged I'm using distinct to only take the unique id value</p>
  
  <pre><code>select distinct(id), username, fullname
  into Whole
  from temp
  </code></pre>
  
  <p>it did decreasing some rows</p>
  
  <h1>Result</h1>
  
  <p>But after I move it to whole table I would like to put primary key on id but I got the message that there are some duplicate values. Is there any other way?</p>