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 -> Re: retrieving only the column label

Re: retrieving only the column label

From: Lee, Seung K. <vrman_at_sl2sys.co.kr>
Date: Sun, 11 Mar 2001 03:27:25 +0900
Message-ID: <98dr7b$n1o$1@news2-2.kornet.net>

SQL> select emailid as EMAIL, memberid as EEE from tb_email;

     EMAIL EEE
---------- ----------

     20166     100000
     20153     100000
     20167     100000

and

SQL> select emailid as EMAIL, memberid as EEE from tb_email where rownum <1;

no rows selected


I'm using oracle 8.1.6....

Thanks for the reply.... but...any other solutions?

"Lothar Armbrüster" <la_at_oktagramm.de> wrote in message news:PM00037F2ACAF4CC87_at_hades.unknown.dom...
> 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.de
Received on Sat Mar 10 2001 - 12:27:25 CST

Original text of this message

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