CREATE TABLE AS ... WITH DATA AND STATISTICS

Database
Teradata Employee

CREATE TABLE AS ... WITH DATA AND STATISTICS

Hello!

In V2R6, added functionality is provided to copy over statistics when using CREATE TABLE AS syntax. We have noticed that it does not function as we had thought it would.

Has anyone ever used CREATE TABLE AS ... WITH DATA AND STATISTICS and then ran a HELP STATS and received the error around no statistics defined?

Does anyone know the rules/conditions for WITH DATA AND STATISTICS and when it works and when it doesn't work?

Many thanks and kind regards,

Andrew Livingston
1 REPLY
Junior Contributor

Re: CREATE TABLE AS ... WITH DATA AND STATISTICS

Hi Andrew,
the rules are explained in detail in

SQL Reference: Data Definition Statements
Chapter 3: SQL Data Definition Language Statement Syntax (CREATE TABLE - CREATE VIEW)
CREATE TABLE (AS Clause)

Dieter