What if:

Mysqldump TABLE --where="id<@middle" >> first_part.sql
Mysqldump TABLE --where="id>[EMAIL PROTECTED]" >> second_part.sql


@middle can be calculated in another place


And then:
You will need to edit each file to change table name


:: ISC Edwin Cruz Garcia ::
IT Factory Systems - Systems Department
Texas Instruments de Mexico
(449)9105194 Direct Line
(449) 9105100 Switchboard, Ext. 5194
(449) 9105124 Fax
E-mail: [EMAIL PROTECTED]

-----Original Message-----
From: Atle Veka [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 13, 2005 10:33 PM
To: Brian Dunning
Cc: mysql@lists.mysql.com
Subject: Re: Split a table?

Depends on how your table is designed. You could do an 'INSERT INTO ..
SELECT FROM ..' with a WHERE/ORDER BY/LIMIT combo (switch the ORDER BY for
each new table). It would be probably easiest if you have an AUTO_INCREMENT
field..



Atle
-
Flying Crocodile Inc, Unix Systems Administrator

On Tue, 12 Jul 2005, Brian Dunning wrote:

> If I have a table with 200K records, is there an easy way to split it 
> into two separate tables with 100K records each?
>
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to