Bug #22626 Impossible to give just a column name in CREATE TABLE AS
Submitted: 23 Sep 2006 10:52 Modified: 23 Sep 2006 12:51
Reporter: Maciej Pilichowski Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DDL Severity:S4 (Feature request)
Version:5.0.24a OS:Linux (opensuse 10.0)
Assigned to: CPU Architecture:Any

[23 Sep 2006 10:52] Maciej Pilichowski
Description:
SQL compliance violation.

I can
CREATE TABLE T1 (COL int) AS SELECT ID FROM T2;
CREATE TABLE T1 AS SELECT ID FROM T2;

(good) but I can't
CREATE TABLE T1 (COL) AS SELECT ID FROM T2;

How to repeat:
Just analyze the description.

Suggested fix:
Allow middle-way -- giving column name, but with type omission.
[23 Sep 2006 12:51] Valeriy Kravchuk
Thank you for a problem report. It looks like a reasonable feature request for me.
[6 Oct 2006 13:46] Sergei Golubchik
Currently we don't support the standard

  CREATE TABLE ... ( <column name list> ) AS <subquery>

syntax. Our

  CREATE TABLE ... ( <table element> [{ <comma> <table element> }... ] ) [AS] <subquery>

has different semantics.
Supporting standard semantics is a valid feature request, of course.