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.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.