Link to home
Start Free TrialLog in
Avatar of donvike1
donvike1Flag for United States of America

asked on

How do I add a column to my existing table in a specific location?

Hi all,

I have an existing table and I want to add a column to the table, but I don't want the column to be at the end of the table I would like to place the column between 2 other columns in the table.  How do I do this?

alter table REQUEST
add SLE_DATE DATE;

ASKER CERTIFIED SOLUTION
Avatar of Corey Habbas
Corey Habbas
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Naveen Kumar
but I don't want the column to be at the end of the table I would like to place the column between 2 other columns in the table.  How do I do this?   ------------> What is your requirement because i do not see any value addition by having it in the middle. It does not really matter in which order your column appears in the table.
Other option I can think of is to create a VIEW out of your table where in you can specify the column order.

So instead of selecting from the table, you do select from VIEW
Avatar of donvike1

ASKER

The SLE_DATE is not within any of my tables, this is a stand alone field that I need to enter.  I get the following error when I execute the table:  SLE_DATE: invalid identifier  
You cannot alter a table and reorder the columns like that the same way you can in mysql. byten has the corrent answer in that you need to recreate the table with the new column order.