title: collect stats in teradata 14 - Multiple statistics with different column ordering on the same set of columns are not allowed
body: <p>There is another gotcha with Teradata 14 (courtesy of TC) that may catch people out.</p>
  
  <p>Using a table defined like this:</p>
  
  <pre><code>CREATE TABLE test( 
  CALENDAR_DATE DATE FORMAT 'YY/MM/DD' NOT NULL           
  ,RETAIL_OUTLET_NUMBER INTEGER NOT NULL   
  ,BASE_PRODUCT_NUMBER INTEGER NOT NULL      
  ) 
  PRIMARY INDEX (calendar_date, retail_outlet_number, base_product_number)
  </code></pre>
  
  <p>This SQL will fail:</p>
  
  <pre><code>COLLECT STATS test COLUMN(
  calendar_date, base_product_number, retail_outlet_number); 
  </code></pre>
  
  <p>with the error message: </p>
  
  <blockquote>
    <p>3706: Syntax error: Multiple statistics with different column ordering on the same set of columns are not allowed</p>
  </blockquote>
  
  <p>But:</p>
  
  <pre><code>COLLECT STATS test COLUMN(
  calendar_date, retail_outlet_number, base_product_number);
  </code></pre>
  
  <p>will be OK. </p>
  
  <p>The order of the columns must now be the same in the collect stats statement and the primary index.</p>
  
  <p>...</p>
  
  <p>Is there any other way to make them work with out changing the column order???</p>
  
  <p>Thanks...</p>