Sorry but this is not related to my example.
I have AS in inner select. My select return
name as specified.
Problem I have is with create table as where
name is changed.
I give example like this:
select d from (select c AS d from (select a AS c from test));
I get d as column name. If I create table with
create table as I get a as column name.
Simon Slavin je 22.12.2017 ob 17:33 napisal:
On 22 Dec 2017, at 3:04pm, Tim Streater <[email protected]> wrote:
2) I don't see this issue mentioned when I read the PHP documentation about
their SQLite interface, nor do I see it in the Xojo docs about *their*
interface either. I assume their interfaces are not rewriting SELECT statements
to include AS for every column selected, so should they be warning their users
about it?
If you want to depend on the name of a column, use AS. If column names without
AS were documented in the SQL standard, and SQLite / PHP / Xojo violated that
standard, then there would need to be a warning. But there’s no standard for
column names without AS in the SQL standard so no warning is needed.
If you think that column names are simple, please consider this:
CREATE TABLE ta (ca INTEGER);
CREATE TABLE tb (cb INTEGER);
SELECT ca FROM ta UNION SELECT cb FROM tb;
What should the name of the resulting column be ?
Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users