Solved

SQL referencing a column number

Posted on 2010-11-26
4
506 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
  • 2
4 Comments
 
LVL 142

Accepted Solution

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

Expert Comment

by:Naveen Kumar
Comment Utility
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
Comment Utility
As AngelIII said already, it is not possible in the select list.
0
 

Author Comment

by:deanlee17
Comment Utility
Ok thanks guys.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to recover a database from a user managed backup

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now