Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: most sold pc's query?
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