Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8458169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:00:26+00:00 2026-06-10T13:00:26+00:00

Lets say I already have 3 columns A,B,C in my table Tb. I want

  • 0

Lets say I already have 3 columns A,B,C in my table Tb. I want to add a new column M between B and C. How can I do this ?

After adding M,my table should look like – A B M C and NOT A B C M ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:00:27+00:00Added an answer on June 10, 2026 at 1:00 pm

    The simple answer is that you can’t. Columns are always added at the end. However, you shouldn’t care about the order of columns in a table since you should always be explicitly listing columns in your queries and in your DML. And you should always have an interface layer (a view, for example) where, if order is important, you can add the new column in the appropriate place.

    If you are really determined, you can create a new table with the new column order, move the data to the new table, drop the old table, and rename the new table. You’ll need to recreate any indexes, constraints, or triggers on the table. Something like

    ALTER TABLE tb
      ADD( M NUMBER );
    
    CREATE TABLE tb_new
    AS
    SELECT a, b, m, c
      FROM tb;
    
    DROP TABLE tb;
    
    ALTER TABLE tb_new 
      RENAME TO tb;
    

    I’m not sure whether it’s an option in the express edition (I tend to doubt it is but I don’t have an XE database handy to verify) but you could also potentially use the DBMS_REDEFINITION package as Barbara shows in that example. Behind the scenes, Oracle is doing basically the same thing that is done above but with some added materialized view logs to allow applications to continue to access the table during the operation.

    If you find yourself caring about the order of columns in a table, though, you’re much better off stopping to figure out what you’ve done wrong rather than continuing to move forward on either path. It should be exceptionally, exceptionally rare that you would care about the physical order of columns in a table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables. Lets say they look like this Table Sports: Column 1:
Lets Say i have a table like this WEB_LIST_TABLE KEY Value ---------------------------------------- 134 google.com
Lets say I have a database table which consists of three columns: id ,
Lets say I have a table with just two columns: name and mood .
Lets say I have a simple table that only contains two columns: MailingListUser -
Any code for checking a table-column's value? Lets say we have a table submittedpictures
lets say i have a table like this : a | b | c
Lets say I have five tables named table1, table2 ... table5. I have already
Lets say we have a table here, populated with the following data: acc_id1 acc_id2
Lets say I have a class A that is fairly simple like this -

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.