title: Teradata Temporary Table
body: <p>I need help with creating temporary tables in Teradata. Below I am creating a global temporary table  TOPTABLE3. Then I am inserting 10 rows into the table. However, then when I query the table, I only get 0 rows returned which shows that the records were not inserted into the temporary table. Thanks in advance. </p>
  
  <pre><code>CREATE global temporary table  TOPTABLE3 (
  TABLE1  VARCHAR(20))
  </code></pre>
  
  <p>-- CREATE TABLE completed. 0 rows processed. Elapsed Time = 00:00:01</p>
  
  <pre><code>INSERT INTO TOPTABLE3 
  SEL          top 10 TABLE1  
  FROM    schema.table 
  where       table.column1 = 'D'  
  and  table.column2 = CAST('01/01/2017' AS DATE FORMAT 'MM/DD/YYYY')    
  </code></pre>
  
  <p>-- INSERT completed. 10 rows processed. Elapsed Time = 00:00:06 Output directed to Answer window</p>
  
  <pre><code>SELECT  *
  FROM     My_ID.TOPTABLE3
  </code></pre>
  
  <p>-- SELECT completed. 0 rows returned. Elapsed Time = 00:00:02</p>