C
Chris M
Hi Group.
I'm sure this should be straight forward, but I just can't get my head round
the most efficient way to do it...
I have 2 tables.
PARTS(14,000 Records)
PART_NO DESCRIPTION
SALES(120,000 Records)
PART_NO SALES_DATE SALE_PRICE
What I want is a query to show the following:
PART_NO DESCRIPTION AVG_SALE
Where AVG_SALE is the average of the last 3 SALES (ie from the SALES table
for that PART_NO for the highest 3 SALES_DATEs)
Any suggestions gratefully received.
Chris.
I'm sure this should be straight forward, but I just can't get my head round
the most efficient way to do it...
I have 2 tables.
PARTS(14,000 Records)
PART_NO DESCRIPTION
SALES(120,000 Records)
PART_NO SALES_DATE SALE_PRICE
What I want is a query to show the following:
PART_NO DESCRIPTION AVG_SALE
Where AVG_SALE is the average of the last 3 SALES (ie from the SALES table
for that PART_NO for the highest 3 SALES_DATEs)
Any suggestions gratefully received.
Chris.