Re: [HACKERS] Re: [GENERAL] Re: [PHP3] Re: PostgreSQL vs Mysql comparison
| От | Thomas Lockhart |
|---|---|
| Тема | Re: [HACKERS] Re: [GENERAL] Re: [PHP3] Re: PostgreSQL vs Mysql comparison |
| Дата | |
| Msg-id | 37FA043E.E8ABA442@alumni.caltech.edu обсуждение исходный текст |
| Ответ на | Re: [GENERAL] Re: [PHP3] Re: PostgreSQL vs Mysql comparison (The Hermit Hacker <scrappy@hub.org>) |
| Список | pgsql-hackers |
> Anyone want to comment on this one? Just tested with v6.5.0 and it still
> exists there...
> vhosts=> create table test ( a int, b char );
> CREATE
> vhosts=> insert into test values ( 1, 'a' );
> INSERT 149258 1
> vhosts=> select a from test group by a having a > 0;
> ERROR: SELECT/HAVING requires aggregates to be valid
Oh, don't get me started again on crashme :(
What is the purpose of the previous query? It seems to be equivalent
to
select distinct a where a > 0;
We do support the HAVING clause, but apparently disallow some
degenerate cases. If MySQL weren't just a toy db, perhaps they would
start putting real queries into their garbage crashme. There, I feel
better now ;)
postgres=> select b, avg(a) from test group by b having avg(a) > 0;
b|avg
-+---
a| 1
(1 row)
- Thomas
--
Thomas Lockhart lockhart@alumni.caltech.edu
South Pasadena, California
В списке pgsql-hackers по дате отправления: