Re: Top 5 Hitters?

From: darryl snedeker <darryl.snedeker_at_amd.com>
Date: 1995/07/27
Message-ID: <DCEAn4.45H_at_txnews.amd.com>#1/1


Frank,

I don't think what you're attempting to do AND the method you're using will work because you're computing an aggregate total. If however, you had a table where the summation of hits was associated with a single player, the implementation of your script would work fine.

At this point, I can only suggest two resolves:

  1. add a column to your PLAYER table called hits, and update it accordingly and as frequently as you wish. modify you query as follows: SELECT SSN, LASTNAME, FIRSTNAME, HITS FROM PLAYER outer where 5 > (select count(*) from PLAYER inner where inner.HITS > outer.HITS);
  2. create a temporary table that produces the total hits by player and utilize suggested query from above.

Option #1 would be my preference, but you will find that both work. Oracle 7.3 is suppose to have the functionality that will permit the type of processing your original query was shooting for.

Good Luck,
D Received on Thu Jul 27 1995 - 00:00:00 CEST

Original text of this message