Re: Top 5 Hitters?

From: darryl snedeker <darryl.snedeker_at_amd.com>
Date: 1995/07/27
Message-ID: <DCEAvw.4AL_at_txnews.amd.com>#1/1


Frank,

You're query is close, but the problem lies in the aggregate total you are computing. While the functionality you're looking may be available in Oracle v7.3.x, I don't believe this task can be performed as is.

Let me suggest that you add a column called HITS to your PLAYER table. Create an update that summarizes the hits/player accordingly.

Once the update is complete, the following query will give you the results you're looking for:

select SSN, NAME, HITS
from PLAYER outer
where
5 > (select count(*) from PLAYER inner

     where inner.HITS > outer.HITS);

Please let me know how you make out.

Good Luck

D Received on Thu Jul 27 1995 - 00:00:00 CEST

Original text of this message