Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Query to get the data of all the columns in a table except any one column

811495Jun 9 2011 — edited Jun 10 2011
Can anyone please tell how to write a query to get the data of all the columns in a table except one particular column..

For Example:

Let us consider the EMP table.,

From this table except the column comm all the remaining columns of the table should be listed
For this we can write a query like this..

Select empno, ename, job, mgr, sal, hiredate, deptno from emp;

Just to avoid only one column, I mentioned all the remaining ( 7 ) columns of the table in the query..
As the EMP table consists only 8 columns, it doesn't seem much difficult to mention all the columns in the query,
but if a table have 100 columns in the table, then do we have to mention all the columns in the query..?
Is there any other way of writing the query to get the required result..?

Thanks..
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2011
Added on Jun 9 2011
20 comments
1,751 views