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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Simple SQL Question

Re: Simple SQL Question

From: Pavan Muzumdar <pmuzumdar_at_mvsoftware.com>
Date: Tue, 20 Feb 2001 17:40:37 GMT
Message-ID: <p_xk6.10254$0u5.2477555@news1.rdc1.mi.home.com>

Sorry, my bad. I should have left the part in the original message that asked how to do this without using UNIONs.

Pavan

"Beth Katcher" <b.katcher_at_rcn.com> wrote in message news:3A92A549.40C71E9E_at_rcn.com...
> > > Is there a simple way to query a table whose records are formatted as
> > > follows:
> > >
> > > FIELD1 VARCHAR(12) - Ex. Data: NORTH
> > > FIELD2 VARCHAR(12) - Ex. Data: 1000
> > > FIELD3 VARCHAR(12) - Ex. Data: 2000
> > > FIELD4 VARCHAR(12) - Ex. Data: 3000
> > >
> > > with a result set that contains multiple records in the following
 format:
> > >
> > > NORTH 1000
> > > NORTH 2000
> > > NORTH 3000
>
> (Lots of confusing stuff snipped . . .)
>
> Why not:
> select field1, field2 from yourtable
> union
> select field1, field3 from yourtable
> union
> select field1, field4 from yourtable;
>
> Then go back and redesign the table properly.
>
> -- Beth
Received on Tue Feb 20 2001 - 11:40:37 CST

Original text of this message

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