19 Aug 22:58
Correct SQL name resolution on AS clauses in a SELECT?
From: D. Richard Hipp <drh@...>
Subject: Correct SQL name resolution on AS clauses in a SELECT?
Newsgroups: gmane.comp.db.sqlite.general
Date: 2008-08-19 20:59:45 GMT
Subject: Correct SQL name resolution on AS clauses in a SELECT?
Newsgroups: gmane.comp.db.sqlite.general
Date: 2008-08-19 20:59:45 GMT
Consider a table:
CREATE TABLE t1(a INTEGER, b INTEGER);
INSERT INTO t1 VALUES(1,2);
INSERT INTO t1 VALUES(9,8);
I am reworking (read: trying to fix) the name resolution algorithm in
SQLite and I am wondering what is the correct behavior of the
following queries? Can anybody tell me what PostgreSQL or MySQL or
SQL Server or Oracle do with these?
SELECT a AS b, b AS a FROM t1 ORDER BY a;
SELECT b AS a, a AS b FROM t1 ORDER BY a;
SELECT a, b AS a FROM t1 ORDER BY a;
SELECT a AS x, b AS x ORDER BY x;
SELECT a AS b, b AS a WHERE a=1;
SELECT a AS b, b AS a WHERE a=2;
SELECT a AS x, b AS x WHERE x=1;
D. Richard Hipp
drh@...
_______________________________________________
sqlite-users mailing list
sqlite-users@...
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
RSS Feed