Re: Why using "Group By"

From: Bob Badour <>
Date: Thu, 13 Mar 2003 14:57:29 -0500
Message-ID: <pS5ca.65$>

"oferbu" <> wrote in message
> 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.

Bob Received on Thu Mar 13 2003 - 20:57:29 CET

Original text of this message