Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: retrieving only the column label
Lee, Seung K. wrote:
> Good day group...
>
> here's my problem
>
> All I want the query to return is just the column label,
> preferably with a delimiter I can assign.
>
> Let me elaborate.
> I have
>
> select col1 as NAME, col2 as EMAIL from TABLE;
>
> it would give
>
> NAME EMAIL
> ---------------------------------
> Leee Lee_at_somewhere.com
> .........
> .........
>
> I just want "NAME and EMAIL". Straight forwardly anything after AS.
> If possible with a delimeter ,(comma)
> which would give name,email. Don't need the query result.
>
Try this:
select col1 as NAME, col2 as EMAIL from TABLE where rownum<1;
This will give you no rows of output but the fieldnames etc. of any
possible result.
But beware if your query is more complicated than this Oracle will do
some processing even if no output is generated.
Hope that helps,
Lothar
-- Lothar Armbrüster | la_at_oktagramm.de Hauptstr. 26 | la_at_heptagramm.de D-65346 Eltville | lothar.armbruester_at_t-online.deReceived on Sat Mar 10 2001 - 11:51:40 CST
![]() |
![]() |