title: Re-order columns of table in Oracle
body: <p>I have a table with 50+ columns and I need to swap the order of the first two columns. What is the best way to accomplish this using Oracle? Assume the table name is ORDERDETAILS and as it is, the first two columns are ITEM_ID and ORDER_ID. Once the rename is complete, the table name should still be ORDERDETAILS but the first two columns will be ORDER_ID and ITEM_ID. FWIW, column types and the rest of the columns and their order is irelevent.</p>
  
  <p>Correct me if I'm wrong, but I think the general steps are:</p>
  
  <ol>
  <li>Rename the existing table.</li>
  <li>Drop the primary key constraint.</li>
  <li>Re-create the table with the correct column order.</li>
  <li>List item</li>
  <li>Run INSERT INTO .. SELECT to move the data from temp to the table in step #3.</li>
  <li>Drop the temp table.</li>
  </ol>
  
  <p>I have little experience with Oracle so perhaps I'm missing a step or two.</p>
  
  <p>Does a primary key imply an index in Oracle? Does dropping the primary key also drop the index? </p>
  
  <p>SQL examples are much appreciated.</p>
  
  <p>EDIT: Un-sincere thanks to those who question why it needs done instead of providing help. To answer your question as to why it needs done: I'm following orders from someone else who says I need to do it this way and the order of the columns DOES matter. My thoughts/opinions on this are irrelevent.</p>