title: recursively increment a date in sql
body: <p>I am working on a historical conversion of data and was wondering if there's a more efficient way to accomplish a date increment.</p>
  
  <p>I receive a data from a source system on a saturday date (1-7-13) and would like to push that data to make it fill all days of the previous week (1-6-13,1-5-13 ect).  </p>
  
  <p>So currently i am doing several unions</p>
  
  <pre><code>insert into target
  (date, name)
  select date,name 
  from 
  (
  SELECT date as date, name FROM SOURCE
  UNION
  SELECT date - 1 as date, name FROM SOURCE
  UNION
  SELECT date -2 as date, name FROM SOURCE
  )
  </code></pre>
  
  <p>I only ask because it looks like close to 500 million records are going to be going though this sql script.  Incase it matters it is going to be running in a BTEQ script in TERADATA.</p>