Re: Need SQL guru's help: Best query?

From: pat palguta <pat.palguta_at_daytonoh.ncr.com>
Date: 1996/03/27
Message-ID: <DoxtDr.C0n_at_falcon.daytonoh.attgis.com>#1/1


The GROUP BY clause will NOT order your results. It simply "groups" like information into a single row summary result. Thus the name.
==========Chris Fischer, 3/25/96==========

cdye_at_dnt.dialog.com (Charles Dye (PC)) wrote:

>SELECT model_number, min(model_number)
>FROM model_table
>group by model_number
>order by model_number
>/

In this case, the ORDER BY clause is redundant and unnecessary as to do the GROUP BY oracle will already sort the rows. Adding the order by simply causes oracle to sort the rows again.

+------------------------------------------------------------+
| Chris Fischer                           cfischer_at_nando.net |
| Sr. Systems Analyst                    Work: (919)676-0062 |
| Toys "R" Us                                                |
+------------------------------------------------------------+
Received on Wed Mar 27 1996 - 00:00:00 CET

Original text of this message