Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: newbie sql question
I realize the double posting issue. It was genuinely unintentional. Thanks
for the help.
"Daniel Morgan" <dmorgan_at_exesolutions.com> wrote in message
news:3D9B0D84.D1FBC1B3_at_exesolutions.com...
> ksmith wrote:
>
> > Orace 8i on Linux RH7.2
> >
> > I have two tables, a workorders table and a quotes table. I am trying to
> > count all of the parts that are in the workorders table AND in the
quotes
> > table year to date. However they need to be distinct. For instance some
> > parts are in the workorders table more than once, maybe even by two
> > differnent customers. I can find the DISTINCT partid and customers using
the
> > following script:
> >
> > select distinct q.customerid, q.partid
> > from quotes q, workorders wo
> > where q.partid like wo.partid
> > and q.customerid like wo.customerid
> > and to_number(to_char(q.datetimequoted,'YYYY')) =
> > to_number(to_char(sysdate,'YYYY'))
> > and wo.datetimeentered > q.datetimequoted
> >
> > This returns
> >
> > CUSTOM PARTID
> > ------ --------------------
> > GEN013 4D98592
> >
> > However, I want a count and not the actual customer and part id.
> > wishful SQL:
> > select count(distinct q.partid, q.customerid)
> > .....
> >
> > Any help would be appreciated. As you can probably tell, I am far from
an
> > experience developer or dba. Thanks
>
> Whether a beginner or a newbie you will only get people angry if you
multipost
> or post the same question in more than one newsgroup. So don't.
>
> The information you need is with your other posting.
>
> Daniel Morgan
>
Received on Thu Oct 03 2002 - 09:10:54 CDT
![]() |
![]() |