title: Removing duplicate row using UNION in Teradata SQL
body: <p>I'm using Teradata sql to extract data using UNION.</p>
  <pre><code>SEL CAST(a.dttm AS DATE), count(a.cs) FROM  cin.cell a
  LEFT JOIN cin.comm c ON a.cs_sk = c.cs_sk
  LEFT JOIN CIN.CID d ON a.cn_cd = d.CN_CD
  WHERE CAST(a.dttm AS DATE) &gt;= CURRENT_DATE-10
  GROUP BY 1
  UNION 
  SEL CAST(a.dttm AS DATE), count(a.cs) FROM  cin_ps.cell a
  LEFT JOIN cin_ps.comm c ON a.cs_sk = c.cs_sk
  LEFT JOIN CIN_ps.CID d ON a.cn_cd = d.CN_CD
  WHERE CAST(a.dttm AS DATE) &gt;= CURRENT_DATE-10
  GROUP BY 1
  </code></pre>
  <p>but I'm getting duplicate rows in first column as below Please note, there might be the case there is no row for any particular day for any first set of table or second set of table</p>
  <p>Current result:</p>
  <pre><code>N.  PROCESSED_DTTM  Count(cs)
  1   4/8/2022    40
  2   4/8/2022    66
  3   4/9/2022    49
  4   4/9/2022    71
  5   4/10/2022   117
  6   4/10/2022   1430
  7   4/11/2022   261
  8   4/11/2022   841
  </code></pre>
  <p>Required results:</p>
  <pre><code>N.  PROCESSED_DTTM  Count(cs)
  1   4/8/2022    106
  2   4/9/2022    120
  5   4/10/2022   1547
  7   4/11/2022   1102
  </code></pre>