Personal Oracle Database 10g Release 10.2.0.3.0
   CREATE temp  TABLE t1(a INTEGER, b INTEGER);
     INSERT INTO t1 VALUES(1,2);
     INSERT INTO t1 VALUES(9,8);



SELECT a AS b, b AS a FROM t1 ORDER BY a;
B                      A
---------------------- ---------------------- 
1                     2
9                     8

2 rows selected

SELECT b AS a, a AS b FROM t1 ORDER BY a;
A                      B
---------------------- ---------------------- 
2                     1
8                     9
2 rows selected

SELECT a, b AS a FROM t1 ORDER BY a;
  SQL Error: ORA-00960: ambiguous column naming in select list
  00960. 00000 -  "ambiguous column naming in select list"
  *Cause:    A column name in the order-by list matches more than one select 
list columns.

SELECT a AS x, b AS x ORDER BY x;
  SQL Error: ORA-00923: FROM keyword not found where expected
  00923. 00000 -  "FROM keyword not found where expected"

SELECT a AS b, b AS a WHERE a=1;
  SQL Error: ORA-00923: FROM keyword not found where expected
  00923. 00000 -  "FROM keyword not found where expected"

SELECT a AS b, b AS a WHERE a=2;
  SQL Error: ORA-00923: FROM keyword not found where expected
  00923. 00000 -  "FROM keyword not found where expected"

SELECT a AS x, b AS x WHERE x=1;
  SQL Error: ORA-00923: FROM keyword not found where expected
  00923. 00000 -  "FROM keyword not found where expected" 

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

Reply via email to