Just to be clear: If I define a column in a table named "xxx", and I "select 
xxx from table", the report will show a column named "xxx" always. That's what 
the standard says, right? It's not implementation dependent, right?

CREATE TABLE foo(xxx)
INSERT INTO foo(xxx) VALUES(25)
SELECT xxx FROM foo
---|-----
xxx 25

Doug

> -----Original Message-----
> From: sqlite-users <sqlite-users-boun...@mailinglists.sqlite.org>
> On Behalf Of Adrian Ho
> Sent: Tuesday, December 10, 2019 8:04 AM
> To: sqlite-users@mailinglists.sqlite.org
> Subject: Re: [sqlite] Result set column names
> 
> On 9/12/19 3:45 PM, Graham Holden wrote:
> > Monday, December 09, 2019, 7:25:25 AM, Clemens Ladisch
> <clem...@ladisch.de> wrote:
> >
> >> The SQL-92 standard actually says:
> >>
> >> |    Syntax Rules
> >> |
> >> |    9) Case:
> >> |
> >> |       b) If the i-th <derived column> in the <select list>
> does not
> >> |         specify an <as clause> and the <value expression> of
> that
> >> |         <derived column> is a single <column reference>, then
> the
> >> |         <column name> of the i-th column of the result is C.
> >> |
> > Presumably the third line of clause (b) of the standard SHOULD
> have
> > read: "is a single <column reference> C,", otherwise "is C" has
> > nothing to refer to.
> 
> C is actually defined in a preceding paragraph:
> 
>          5) Let C be some column. Let QS be the <query
> specification>. Let
>             DCi, for i ranging from 1 to the number of <derived
> column>s
>             inclusively, be the i-th <derived column> simply
> contained in
>             the <select list> of QS. For all i, C is an underlying
> column
>             of DCi, and of any <column reference> that identifies
> DCi, if
>             and only if C is an underlying column of the <value
> expression>
>             of DCi, or C is an underlying column of the <table
> expression>
>             immediately contained in QS.
> 
> --
> Best Regards,
> Adrian
> 
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-
> users

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to