Hi, Apparently when a CTE is used, the column name includes the table alias. However, when no CTE is used, the alias is not present in the returned column name.
SQLite version 3.8.4.3 2014-04-03 16:53:12 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. sqlite> create table X (columnA int); sqlite> insert into X values (1); sqlite> .header on sqlite> select alias.columnA from X alias; *columnA* 1 sqlite> with CTE as (select columnA from X) select alias.columnA from CTE alias; *alias.columnA* 1 sqlite> I experienced this when rewriting a query to use CTE in an application that based some logic on the column name. I'd expect not to see the alias either way. Is this a bug or is it expected for CTEs? _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users