Solved

SQL referencing a column number

Posted on 2010-11-26
4
514 Views
Last Modified: 2012-06-21
Hi Experts,

Is it possible in Oracle SQL to refer to a column by its number rather than the actual name of the column?....

i.e

Select (col1)
From
Where

Thanks,
Dean
0
Comment
Question by:deanlee17
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 34216658
no, this is not possible in oracle sql.
0
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 34216662
yes it is possible in an order by clause. something like as shown below :

select deptno, deptname
from dept
order by 2, 1 desc

0
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 34216667
As AngelIII said already, it is not possible in the select list.
0
 

Author Comment

by:deanlee17
ID: 34216690
Ok thanks guys.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to recover a database from a user managed backup
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question