Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Multiple Table Query
You might switch to a partitioned table:
Each day add a new partition
Name the partitions in some 'date-related' way
and generate a view of a single partition if you
want to access the latest one particularly frequently
e.g,
Alter table data_table
add partition p_2000_02_14
values less than (to_date('15-Feb-2000','dd-mon-yyyy));
create or replace view data_view as
select * from data_table partition (p_2000_02_14);
You will need a method for populating the range partitioning column with the correct date for the day, though.
You '%' query becomes:
select count(*) from data_table;
-- Jonathan Lewis Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk M. Misener wrote in message <889r1m$55e$1_at_mohawk.hwcn.org>...Received on Mon Feb 14 2000 - 00:00:00 CST
>I have an application that archives data each day into a table.
>Every day, and new table is created with same structure (same fields, same
>columns).
>The difference being, that the table_name is unique. ex: ARCH_020100,
>ARCH_020200, etc., base on Date.
>
>I'm not sure how construct a query to select count(*) where table_name
"like
>ARCH_%" (something like that).
>
>Can anyone help?
>Thanks.
>
>
>