Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to sort a table data in oracle?

 
aresh babu
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I would like to know if there is an Oracle feature to change the order of columns in an existing table.

I want to avoid to re-create the table and migrate the data.

Thank you and best regards -
Aresh
 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Not sure what your question is about.
Sorting a table data can be achieved using "ORDER BY" Clause.
Oracle feature to change the order of columns in an existing table

Regarding this you can rearrange the columns as you like when you fire the SELECT query.

Regards,
Amit
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would the order of the columns matter? It's just an artifact of physical storage based on the order the columns were defined. When you query, you can write "select col1, col3, col2"; independent of the order in the database. In fact, it is best to avoid select * anyway in case things change.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic