Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Meta Data table??
Z. Martinez wrote:
> I'm trying to generate a summarized table from an existing table.
>
> 1. extract the top 100 products, based on sale amount, by store
> number. The resulting table should have 4 columns,
> i.e store, product_rank_in_store, product_ID, sales_total.
>
> 2. extract the top 20 stores, based on sales amount, by year and by
> region. The resulting table should have 5 columns,
> i.e. year, region, store_rank_in_year_in_region, store, store_sales.
Merry christmas Z! This is my last feat before the holidays so this was
done
in a hurry but I think i will work. I use a table TEST with one column
VALUE
and select the top 5 rows.
create table test (value number);
select t1.value
from test t1, test t2
where t1.value < t2.value
group by t1.value
having count(*) <= 5;
and a happy new year!
-- Sport radio: people listening to people watching people having fun Mailto:roger.wernersson_at_adra.se BTW: All opinions are mine, all mine, and nobody's but mine.Received on Fri Dec 20 1996 - 00:00:00 CST
![]() |
![]() |