Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Why using "Group By"

Re: Why using "Group By"

From: Bob Badour <bbadour_at_golden.net>
Date: Thu, 13 Mar 2003 14:57:29 -0500
Message-ID: <pS5ca.65$hR2.8462398@mantis.golden.net>


"oferbu" <junkbu_at_hotmail.com> wrote in message news:b9b409f2.0303130207.42f8ab91_at_posting.google.com...
> Hello All,
>
> This is a theoretical question. Why do I need to add the "Group By" in
> the following SQL:

Hi Ofer,

The short answer to your question is to allow inadvisable duplicate rows in the result or in the case of sybase to punish users for typos.

If you have access to sybase (or sqlserver probably), try a query like:

select a, b, count(*) from sometable group by a

They seem to treat the expression as some sort of request for a cross product of sometable with itself just to tie up resources on the server. If the statement gave an error instead, one could at least point out that the redundancy aids compile-time error detection.

Regards,
Bob Received on Thu Mar 13 2003 - 13:57:29 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US