Thanks Waleed, that is exactly what I wanted.
And thanks to all the others who responded

John

-----Original Message-----
Sent: 11 February 2003 22:54
To: Multiple recipients of list ORACLE-L


I hope this helps:

--------------------------------------
drop table test_bal ;
--------------------------------------
-- create a sample table
--------------------------------------
create table test_bal( my_pk number);
--------------------------------------
-- Insert sample data
--------------------------------------
begin
for i in 100..21000 loop
  insert into test_bal values (i);
end loop;
end;
----------------------------------------------------------------------------
----------
select  b.rows_cnt as table_rows_cnt, 
        c.mrownum  as acc_rows_cnt, 
        c.my_pk    as bucket_end_inclusive, 
        ceil(c.mrownum * 4/ b.rows_cnt) as bucket_id 
 from (select a.*,rownum mrownum 
         from (select my_pk 
                from test_bal 
                order by 1) a) c, 
      (select count(*) rows_cnt from test_bal) b
where ceil((c.mrownum + 1)* 4/ b.rows_cnt) > ceil( c.mrownum * 4/
b.rows_cnt);
----------------------------------------------------------------------------
----------

Regards,

Waleed


-----Original Message-----
Sent: Tuesday, February 11, 2003 9:19 AM
To: Multiple recipients of list ORACLE-L


Listers,
I have a table of 125M rows (not partitioned) which I am exporting. I want
to break the export into 4 dmp files using the query command on the pk
column.
 
I am looking at how the best way of finding the values of the PK (number)
which are at 25%, 50% and 75% ish for the table so that I can get 4 evenly
sized exports
 
My query line in the parameter file will be along the lines of where 
1)       log_no < xx
2)       log_no >= xx and < yy
3)       log_no >= yy and < zz
4)       log_no >= zz
 
I am thinking of a sql something like the following
 
Select /*+  index ffs(table_name index_name) */
Log_no , floor(log_no / 4), count(*)
>From table_name group by floor(log_no / 4), log_no
 
Version is 8.1.7.1
 
Can anybody help please
 
Thanks
 
John
 
 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Khedr, Waleed
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: <[EMAIL PROTECTED]
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to