db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernt M. Johnsen" <Bernt.John...@Sun.COM>
Subject Strange behaviour when combining column alias and group by
Date Thu, 12 May 2005 08:53:53 GMT
I stumbeled across this strange behaviour when combining coumn alias
and group by:

ij> select * from tt;
I          |J          
-----------------------
1          |2          
2          |3          
1          |2          
2          |3          
2          |3          

5 rows selected
ij> select i, count(*) as cnt from tt group by i;
I          |CNT        
-----------------------
1          |2          
2          |3          

2 rows selected
ij> select i, count(*) as i from tt group by i;
I          |I          
-----------------------
1          |1          
2          |2          

2 rows selected

The last select is obviously wrong! This might be related to
DERBY-127, but if it's not I'll file it asa separate issue.


-- 
Bernt Marius Johnsen, Database Technology Group, 
Sun Microsystems, Trondheim, Norway

Mime
View raw message