Home » SQL & PL/SQL » SQL & PL/SQL » Reversing the column name (11g)
Reversing the column name [message #571148] Wed, 21 November 2012 10:12 Go to next message
rreddyplsql@gmail.com
Messages: 5
Registered: November 2012
Junior Member
How can we reverse the columns in sql like if we have say 100 columns ,100th column should come first,99th in the 2nd and so on....
Re: Reversing the column name [message #571149 is a reply to message #571148] Wed, 21 November 2012 10:14 Go to previous messageGo to next message
Michel Cadot
Messages: 57646
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Reverse where? In a query? In the table definition? On the disk?

Regards
Michel
Re: Reversing the column name [message #571151 is a reply to message #571149] Wed, 21 November 2012 10:20 Go to previous messageGo to next message
BlackSwan
Messages: 21970
Registered: January 2009
Senior Member
Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/
Re: Reversing the column name [message #571262 is a reply to message #571149] Thu, 22 November 2012 11:26 Go to previous messageGo to next message
rreddyplsql@gmail.com
Messages: 5
Registered: November 2012
Junior Member
Reversing the table structure
Re: Reversing the column name [message #571269 is a reply to message #571262] Thu, 22 November 2012 14:04 Go to previous messageGo to next message
Littlefoot
Messages: 18846
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why would you want to do that?
Re: Reversing the column name [message #571360 is a reply to message #571269] Sat, 24 November 2012 08:48 Go to previous messageGo to next message
rreddyplsql@gmail.com
Messages: 5
Registered: November 2012
Junior Member
It has been asked in interview
Re: Reversing the column name [message #571361 is a reply to message #571360] Sat, 24 November 2012 09:03 Go to previous messageGo to next message
Littlefoot
Messages: 18846
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Although you might try with CTAS (Create Table As Select) (after which you should recreate constraints, indexes, triggers, whatever), I suppose that interviewer meant DBMS_REDEFINITION package.
Re: Reversing the column name [message #571362 is a reply to message #571361] Sat, 24 November 2012 09:09 Go to previous messageGo to next message
Michel Cadot
Messages: 57646
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Or simply create a view upon the table.
But, if I was the interviewer, the first answer I'd expect is "the order of the columns in a table is meaningless".

Regards
Michel
Re: Reversing the column name [message #571368 is a reply to message #571362] Sat, 24 November 2012 23:07 Go to previous message
rreddyplsql@gmail.com
Messages: 5
Registered: November 2012
Junior Member
Thanks Michel
Previous Topic: Will This Query Work?
Next Topic: can we place insert statement in loop inside anonymous block?
Goto Forum:
  


Current Time: Thu Apr 24 10:55:11 CDT 2014

Total time taken to generate the page: 0.11214 seconds