I would do
select * into mynewtable from myoldtable ORDER by random() LIMIT 15000
where 15000 in this case is <your table row count>*.6
If you want to create another table with 40% of the remaining data then something like
select * into mynewtable2 from myoldtable where myoldtable.primarykey NOT IN(select primarykey from mynewtable)
]
In this case primarykey you would replace with the primary key field of your table.
Hi,
I want to split a table to 2 small tables. The 1st one contains 60% records which are randomly selected from the source table.
How to do it?
Regards,
Felix
The substance of this message, including any attachments, may be
confidential, legally
privileged and/or exempt from disclosure pursuant to Massachusetts
law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and
delete the material from any computer.