"Celia McInnis" <celia(at)drmath(dot)ca> writes:
> By the way, as a novice, I am/was a little surprised at HAVING to do this,
> since both things in the grouping are just simple functions of the same
> underlying table variable mytimestamp.
The parser cannot be expected to understand that they are equivalent
functions though. As a counterexample imagine that one extracts the
month and the other the day-of-week; grouping by those two cases would
not yield equivalent results. When they are equivalent, the extra
GROUP BY clause is redundant, but still needed to make the query pass
the parser's spec-driven sanity checking.
> notably, the following works in mysql:
MySQL is hardly a reliable reference for correct SQL behavior ;-).
My guess is that they are simply failing to test that the query has
well-defined grouping behavior at all.
regards, tom lane
In response to
pgsql-novice by date
|Next:||From: Tom Lane||Date: 2005-03-22 19:17:39|
|Subject: Re: dump & create with a cron job |
|Previous:||From: Jack Miller||Date: 2005-03-22 18:48:10|
|Subject: dump & create with a cron job|