title: REDSHIFT :Copy only new records and ignore the existing ones
body: <p>I am using an external table that reads JSON files from s3.
  I have transferred data from external table to internal table using this query</p>
  <pre><code>insert into jatinanalysis (title,url,author,published_date,category)
  select b.title,b.link,b.author,b.published_date,category
  FROM  jatinspectrum.extable a, a.enteries b,b.category category
  </code></pre>
  <p>but every time i run this query it is creating duplicate, I want only new queries, existing ones should be ignored.</p>
  <p>update : tried this <a href="https://stackoverflow.com/a/656027/13126651">https://stackoverflow.com/a/656027/13126651</a> but no luck</p>
  <pre><code>insert into jatinanalysis (title,url,author,published_date,category)
  select distinct b.title,b.link,b.author,b.published_date,category
  FROM  jatinspectrum.extable a, a.enteries b,b.category category
  WHERE NOT EXISTS(SELECT * 
                   FROM jatinanalysis
                   WHERE (jatinspectrum.extable.b.title=jatinanalysis.title and
                          jatinspectrum.extable.b.link=jatinanalysis.url and
                          jatinspectrum.extable.b.author=jatinanalysis.author and
                          jatinspectrum.extable.b.b.published_date=jatinanalysis.published_date and
                          jatinspectrum.extable.category=jatinanalysis.category)
  </code></pre>