www.webdeveloper.com
Results 1 to 2 of 2

Thread: MySql copying a whole row into the same table

  1. #1
    Join Date
    Aug 2004
    Location
    Brighton,UK
    Posts
    96

    MySql copying a whole row into the same table

    is there a quick and easy way to copy a whole row in a table and copy it the same table? obviously i want the ID to change to the next auto_increment value.

  2. #2
    Join Date
    Aug 2005
    Location
    The Garden State
    Posts
    5,634
    INSERT INTO the_table(column_list) SELECT column_list FROM the_table;

    obviously you're going to want to skip the ID when doing the column list.
    Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter

    celery is tasteless - currently needing some UI time

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles