Use the INSERT/SELECT combo like this:
INSERT INTO dba (field1,field2,...) SELECT fielda,fieldb,... FROM dba WHERE
...
> Hi there,
>
> I have some data in one table which I have to move to another. No I thought
> of a mysqldump with a where clause. The problem though is, that it also
> tryes to insert the ID which is a autoinc. primary key and already in use by
> another record. How can I produce a insert statement withouth the ID
> included?
>
> This is how I tryed it:
> mysqldump -p "--where= country='us'" -t data beaches > beaches_us.sql
>
> This is a line of output:
> INSERT INTO beaches VALUES (2345,'Carrabelle Beach','US','9');
>
> This is how I would like to have the output:
> INSERT INTO beaches VALUES ('','Carrabelle Beach','US','9');
>
> does anybody know how to do this?
>
> Thanx for any help, Andy
>
> query
>
> ---------------------------------------------------------------------
> 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
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
---------------------------------------------------------------------
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