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

Home -> Community -> Usenet -> c.d.o.server -> Re: poorly written query?

Re: poorly written query?

From: andrew_webby at hotmail <spam_at_no.thanks.com>
Date: Fri, 23 Mar 2001 12:25:56 -0000
Message-ID: <985350390.671.0.nnrp-10.c30bdde2@news.demon.co.uk>

You appear to be missing the join condition (the common field) between your two tables, hence it's adding up everything in sight.

"Sk8er" <Sk8er.not_at_here.net> wrote in message news:uZBu6.3841$5%5.826023_at_news.uswest.net...
> I am trying to run this particular query.................
>
> select collector_id assessor, count(collector_id) num_assmnts,
> count(hotlined_yn) num_hotlines, count(pass_move_yn) num_pins,
> count(suspend_yn) num_suspnds, sum(payment_recvd) pay_recvd,
> count(payment_recvd) num_pays, sum(arts_amt) arts, count(arts_amt)
> arts_total from ollectr.del_acct, collectr.acct_contact where
> rep_review_date< sysdate and rep_review_date>= sysdate- 2 group by
> collector_id;
>
> ..............via sql*plus on an Oracle 8.0.5 database from
> a read only table. The sums add up more than just yesterday's date and it
> takes forever to process. Could someone please give me some advice as to
> what I might be doing wrong? Any help would be much appreciated!
>
>
Received on Fri Mar 23 2001 - 06:25:56 CST

Original text of this message

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