| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Why using "Group By"
"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
![]() |
![]() |