mabye an insert into...select will work, something like: INSERT INTO <new tablename> SELECT Code, Model, Units from <original table> where Year=2003 and ((Code = 'N200') or (Code='N205'));
http://www.mysql.com/doc/I/N/INSERT_SELECT.html -Don -----Original Message----- From: Carlos Fernando Scheidecker Antunes [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 10:25 AM To: MySQL List Subject: How to duplicate records Importance: High Hello all, I've got some records of a Database that I would like to duplicate if possible with an statement. The table has Code, Model, Year, units. The primary key is Code, Model and Year. What I need is to duplicate Code, Model and units for a different year. Say I want to duplicate all records which Code are N200 and N205 with the same model and same units but for year 2003. Is there any select and insert/replace statement to acomplish this? There are about 3.000 records and doing that manually is impossible. I am considering dump the whole file to a .csv and change year to 2003 and then reinsert it. Is there any way to do it in a smart way? Meaning an SQL statement. Thank you, Carlos Fernando. --------------------------------------------------------------------- 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