I noticed this strange behavior on Sqlite since I
started using it. This kind of SQL is not correct and
normally any DB should return an error. For example,
Oracle would return this error: "ORA-00937: not a
single-group group function".
Sqlite does return some kind of result for incorrect
SQL queries. I consider that this is a non-critical
bug that should be fixed in future
Thank you,
Vladimir
--- Will Leshner <[EMAIL PROTECTED]> wrote:
> Say I have a table defined and populated as follows:
>
> CREATE TABLE test (a TEXT);
> INSERT INTO test (a) VALUES ('hello');
> INSERT INTO test (a) VALUES ('hello');
> INSERT INTO test (a) VALUES ('hello');
>
> And I perform the following query:
>
> SELECT rowid,count(a) FROM test
>
> In SQLite I get back:
>
> 3|hello
>
> But in MySQL I get back an error:
>
> #1140 - Mixing of GROUP columns
> (MIN(),MAX(),COUNT()...) with no
> GROUP columns is illegal if there is no GROUP BY
> clause
>
> I'm wondering if MySQL isn't right to treat this as
> an error?
>