Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2005
    Posts
    74

    Unanswered: Help with adding column

    hi guys! I have a table with 3 columns but i realized that i need to add 1 column between column 2 and 3. Can anybody please help me on how to do that? Thanks in advance!

  2. #2
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    just create a new table and populate it like this:

    insert into NewTable
    select col1, col2, 'some value', col3 from OldTable

    then you can drop your old table. be sure to create indexes, fks, etc on the new table as appropriate once it's populated.

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by daimos
    i need to add 1 column between column 2 and 3.
    Quote Originally Posted by Brett Kaiser
    The physical order of data in a database has no meaning.
    Just use alter table and add the field to the end.
    You can always specify the display in your select statements.
    George
    Home | Blog

Posting Permissions

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