Splitting a table is not realy difficult, you could use:

Create table user_info select fieldname1,fieldname2,... from
large_table_name;

But you'll probably want a connection between the new tables.
you could add a ID-record first by doing:

alter table large_table add ID int unsigned auto_increment primary key;
and then use the create table and include this field like for example:

Create table user_info select ID,fieldname_1,fieldname_2,... from
large_table_name;
Create table product_info select ID as ID_user,fieldname_a,fieldname_b,...
from large_table_name;
Create table product_definition select ID as
ID_user,fieldname_x,fieldname_y,... from large_table_name;

This way you'll have the product_info and product_definition linked to user.
It's probably best to add an auto_increment ID to product_info and
product_definition.

alter product_info table add ID int unsigned auto_increment primary key;

The ID's that were created in create table statement are no longer
auto_increment so for the user_info table you should do this:

alter table user_info modify ID int unsigned auto_increment primary key;


Remco


----- Original Message -----
From: "Daniel Negron/KBE" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 10, 2002 4:54 AM
Subject: Splitting a Table


Hi All,

mysql newbie here, this may be a silly question, but I couldn't figure out
how to word it for a google search

I want to take a table that someone created, a break it up so that one
table is NOT 125 fields large.  I want to separate the table into user
info, product info and product definition.  everything happens to be in the
same table.  The table is heavily occupied with 20,000 entries.  How would
I start to execute this task ?



Thank You

<><><><><><><><><><><><><><><><>

Daniel Negrón
Lotus Notes Administrator / Developer
KB Electronics, Inc.
954.346.4900x122
http://www.kbelectronics.com

<><><><><><><><><><><><><><><><>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to