Re: Create new table and insert other table data
Hi ,
Do like this ...
( But I am not sure whether Constraints are copied ..)
mysql>CREATE TABLE tbl_200410
AS
SELECT Field1,Field2,Field4
FROM
master;
( For selecting Field1,Field2,Field4 from master)
You may also give conditions in SELECT statement
mysql>CREATE TABLE tbl_200410
AS
SELECT Field1,Field2,Field4
FROM
master
WHERE Field1 IS NOT NULL;
Hope this helps ,
Regards,
Ram.
P.S:
However , Check the description of both tables
mysql> DESC master;
mysql>DESC tbl_200410;
and check constraint info ...
Otherwise ALTER tbl_200410 to add the required constraints...
We Learn the Most When we have to Invent