Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Statment
> 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
![]() |
![]() |