Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> column name as a part of the result set

column name as a part of the result set

From: Tod <dontbotherspammers_at_yahoo.com>
Date: 12 Feb 2004 12:12:30 -0800
Message-ID: <f85005b4.0402121212.10a0e0d5@posting.google.com>


Is it possible to get the column name as a part of the result in a query without using PL/SQL? I can use a procedure if necessary. Below is a simple example but the real tables have many more columns.

Base_Table:

ID_COL		VAL_COL
1		One
2		Two

Audit_Table:
ID_COL		VAL_COL
1		One
2		Too

Select
	at.ID_COL,
	at.VAL_COL,
	column_name (this is what I need)
From
	Audit_Table at,	
	Base_Table bt
	
Where
	bt.ID_COL = at.ID_COL
	and bt.VAL_COL !=  at.VAL_COL;

The result set would be something like:
ID_COL		VAL_COL	        column_name
2		Too		VAL_COL

Any ideas?

Thanks, Tod Received on Thu Feb 12 2004 - 14:12:30 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US