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: most sold pc's query?

Re: most sold pc's query?

From: Daniel Morgan <damorgan_at_exxesolutions.com>
Date: Fri, 09 May 2003 06:28:15 -0700
Message-ID: <3EBBACEF.39C32FB7@exxesolutions.com>


drukqs wrote:

> Hello
> In a form I like to display which pc's are sold the most in one month. This
> is what I have:
>
> declare
> pcnr varchar2(6);
> begin
> select count(pcnr)
> into :testblock.number_of_pcs
> from computerssold
> where pcnr = computerssold.pcnr
> end;
>
> Now this is to count all the computers sold ever. I get back a number of
> how many computers are sold ever (you get it). Now I like to display the
> computer sold the most times in one month. Hope someone can help me a bit.
> Thx

Then you probably want to do something involving the MAX function and in your WHERE clause use the BETWEEN operator.

--
Daniel Morgan
http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Fri May 09 2003 - 08:28:15 CDT

Original text of this message

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