Joe Wilson <[EMAIL PROTECTED]> wrote: --- Ken wrote:
> Doing this in oracle results in an error:
>
> SQL> select max(addr_id), emp_id from z_address;
> select max(addr_id), emp_id from z_address
> *
> ERROR at line 1:
> ORA-00937: not a single-group group function
As
--- Ken <[EMAIL PROTECTED]> wrote:
> Doing this in oracle results in an error:
>
> SQL> select max(addr_id), emp_id from z_address;
> select max(addr_id), emp_id from z_address
> *
> ERROR at line 1:
> ORA-00937: not a single-group group function
As expected.
> I think an
Doing this in oracle results in an error:
SQL> select max(addr_id), emp_id from z_address;
select max(addr_id), emp_id from z_address
*
ERROR at line 1:
ORA-00937: not a single-group group function
I think an error is more appropriate when there is no group by clause. But
At 11:41 PM -0800 1/14/08, Joe Wilson wrote:
In sqlite, assuming there's at least one row, an aggregate SELECT
with no GROUP BY clause is conceptually the same as an equivalent
SELECT with GROUP BY NULL - i.e., the group of all rows.
(I say 'conceptually' because GROUP BY NULL is much slower).
--- Darren Duncan <[EMAIL PROTECTED]> wrote:
> At 10:17 PM -0500 1/14/08, Griggs, Donald wrote:
> >Regarding: " A DBMS accepting such queries isn't just a little
> >dangerous, its flat out wrong. I would ask what rationale there is for
> >this query not failing. -- Darren Duncan"
> >
> >I'm not
At 10:17 PM -0500 1/14/08, Griggs, Donald wrote:
Hi Duncan,
Regarding: " A DBMS accepting such queries isn't just a little
dangerous, its flat out wrong. I would ask what rationale there is for
this query not failing. -- Darren Duncan"
I'm not asserting that you have to agree with the
Hi Duncan,
Regarding: " A DBMS accepting such queries isn't just a little
dangerous, its flat out wrong. I would ask what rationale there is for
this query not failing. -- Darren Duncan"
I'm not asserting that you have to agree with the rationale, but did you
see and read the discussion that
At 3:14 PM +0200 1/14/08, Lauri Nurmi wrote:
SQLite seems to be accepting SELECT queries that use aggregate
functions without a GROUP BY. This is a little dangerous, because
queries that should not work at all are returning sensible-looking
results.
sqlite> SELECT MAX(a), b FROM T;
7|Mouse
This issue is debated from time to time on the list:
http://www.mail-archive.com/sqlite-users@sqlite.org/msg17769.html
The only other database that I'm aware of that supports selecting
non-aggregates that are not listed in GROUP BY is MySQL:
-- valid in sqlite and mysql, invalid in postgres
in SELECT without GROUP BY
Hello,
SQLite seems to be accepting SELECT queries that use aggregate functions
without a GROUP BY. This is a little dangerous, because queries that
should not work at all are returning sensible-looking results
Hello,
SQLite seems to be accepting SELECT queries that use aggregate functions
without a GROUP BY. This is a little dangerous, because queries that
should not work at all are returning sensible-looking results.
Example:
Let's have a simple table T with the following structure and
11 matches
Mail list logo