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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Statment

Re: SQL Statment

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Thu, 17 Jun 1999 15:44:48 -0700
Message-ID: <37697A60.6514C435@exesolutions.com>


> Witthout looking at the explain plan that's very difficult to tell, though
> usually both the group by and the order by result in sorts.
> But why don't you just write an ordinary join, like this
>
> select rep.repnomfan, sum(pedtotinf) venda
> from puket.avpeca, puket.coreca rep
> where avpeca.repcod = rep.repcod /* assuming you are using the rule based
> optimizer and you want coreca to be the driving table */
> and rep.repstacod = 'A'
> group by rep.repnomfan
> order by venda

And by all means make sure that you have an index that corresponds with your WHERE clause.

Daniel A. Morgan Received on Thu Jun 17 1999 - 17:44:48 CDT

Original text of this message

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