🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.databases.oracle.misc
Article #130

Re: SQL Statment

#130
From: Daniel A. Morgan
Date: Thu, 17 Jun 1999 00:00
16 lines
1791 bytes
> 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
Technical Details
Message-ID: <37697A60.6514C435@exesolutions.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7k8vrg$2qls@enews3.newsguy.com> <929568998.21787.0.pluto.d4ee154e@news.demon.nl>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb53f,5fe1e418263968a5
X-Google-Attributes: gidfb53f,public
X-Google-Thread: f99a8,5fe1e418263968a5
X-Google-Attributes: gidf99a8,public
X-Google-Thread: fa4f9,5fe1e418263968a5
X-Google-Attributes: gidfa4f9,public
X-Google-Thread: 1143a7,5fe1e418263968a5
X-Google-Attributes: gid1143a7,public
X-Google-Thread: 10747e,5fe1e418263968a5
X-Google-Attributes: gid10747e,public
From: "Daniel A. Morgan" <dmorgan@exesolutions.com>
Subject: Re: SQL Statment
Date: 1999/06/17
Message-ID: <37697A60.6514C435@exesolutions.com>
X-Deja-AN: 490851612
Content-Transfer-Encoding: 7bit
References: <7k8vrg$2qls@enews3.newsguy.com> <929568998.21787.0.pluto.d4ee154e@news.demon.nl>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: ensg-wks@attws.com
X-Trace: redftp.redftp.attws.com 929659654 14065 141.204.179.224 (17 Jun 1999 22:47:34 GMT)
Organization: EXE Solutions
Mime-Version: 1.0
NNTP-Posting-Date: 17 Jun 1999 22:47:34 GMT
Newsgroups: comp.databases.oracle.misc,comp.databases.oracle.server,comp.lang.basic.visual.database,hannover.uni.comp.oracle,relcom.comp.dbms.oracle