SQLite User Forum

erroneous language in documentation for CREATE TABLE AS…
Login

erroneous language in documentation for CREATE TABLE AS…

(1) By punkish on 2024-01-30 16:19:37 [source]

The table has the same number of columns as the rows returned by the SELECT statement.

Should really be "The table has the same number of columns as the columns returned by the SELECT statement."

https://www.sqlite.org/lang_createtable.html

(2) By Bo Lindbergh (_blgl_) on 2024-01-30 17:49:00 in reply to 1 [link] [source]

No, that makes less sense. Columns don't have columns; rows have columns.

(3) By punkish on 2024-01-30 17:56:23 in reply to 2 [link] [source]

well, yours is one way to look at it :). At the very least, the sentence is ambiguous enough to be read the way I did (even though I know better). Perhaps it should be… "The table has the same number of columns as the columns in the rows returned by the SELECT statement"

(4) By Larry Brasfield (larrybr) on 2024-01-30 21:17:01 in reply to 3 [link] [source]

The table has the same number of columns as are in the SELECT result set.

Consider this CLI input: create table Gallant(x,y); create table Goofus as select * from Gallant; , in which the 2nd DDL statement has no rows returned but does have a result set to work with.