Solved

SQL referencing a column number

Posted on 2010-11-26
4
510 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
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sql help 8 55
grant user/role question 11 25
Sql Stored Procedure field variable 17 27
Oracle 12c Localhost trying to create a Migration Repo, need help with User creation. 13 25
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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.

813 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

12 Experts available now in Live!

Get 1:1 Help Now