--- [EMAIL PROTECTED] wrote:
> The current name resolution rules for SQLite are that it
> first tries to resolve names using just the tables in the
> join.  If that fails, then it looks at result column aliases.
> I think that approach continues to work on WHERE.  But I need
> to reverse the search order on ORDER BY - the column aliases
> need to take precedence over tables in the join.

Should GROUP BY follow the WHERE resolution rules or the proposed
new ORDER BY rules?

Given:

  create table t1(a INT, b INT, c INT);
  insert into t1 values(1, 2, 4);
  insert into t1 values(2, -1000, 5);

mysql>   select a, a+b AS c from t1 group by c, a order by c, a;
+------+------+
| a    | c    |
+------+------+
|    2 | -998 |
|    1 |    3 |
+------+------+

postgres=> select a, a+b AS c from t1 group by c, a order by c, a;
ERROR:  column "t1.b" must appear in the GROUP BY clause or be used in an 
aggregate function





      
____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to