| Author |
How to sort a table data in oracle?
|
aresh babu
Ranch Hand
Joined: Aug 31, 2008
Posts: 65
|
|
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
Joined: May 14, 2004
Posts: 490
|
|
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
internet detective
Marshal
Joined: May 26, 2003
Posts: 26496
|
|
|
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.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: How to sort a table data in oracle?
|
|
|