Joe Wilson wrote:

--- [EMAIL PROTECTED] wrote:

SQLite accepts the above and does the right thing with it.
It is the equivalent of saying:

  SELECT a FROM (SELECT a,b FROM qqq GROUP BY b);


Not sure what you mean by the "right thing". It's not obvious why the rows returned by this GROUP BY are significant.

sqlite> select a,b from qqq group by b;
2|9
3|10
-3|11

mysql> select a,b from qqq group by b;
+------+------+
| a    | b    |
+------+------+
| 4    |    9 |
| 1    |   10 |
| 4    |   11 |
+------+------+
3 rows in set (0.00 sec)

postgresql says:
ERROR: column "qqq.a" must appear in the GROUP BY clause or be used in an aggregate function

oracle says:
ORA-00979: non รจ un'espressione GROUP BY
(in translation: this is not a GROUP BY expression)

as you see, the two engines returning a result give different results on the same data inserted in the same order. as Joe, I also don't see which should be considered "the" right thing and would rather have an error message.

what does SQL92 say?

regards,
Mario

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

Reply via email to