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: how to make 2 rows into 1 row?

Re: how to make 2 rows into 1 row?

From: Jim Lyons <jlyons_at_uts.cc.utexas.edu>
Date: Thu, 4 Jul 2002 08:38:52 -0500
Message-ID: <Pine.OSF.4.44.0207040837390.2833-100000@curly.cc.utexas.edu>


> ImPrecise (f_puhan_at_precise.com) wrote:
> In article
> Jim Lyons <jlyons_at_uts.cc.utexas.edu> wrote:
>
> > Daniel Morgan <dmorgan_at_exesolutions.com> wrote in message
> > news:<3D220445.51EF1447_at_exesolutions.com>...
> > > julio wrote:
> > >
> > > > We have 2 rows of data. They are for the same item but have different data
> > > > and we want 1 row. Does Sajar know?
> > > >
> > > > Terminal rating1 rating2
> > > > 1234 23 34
> > > >
> > > > Terminal addr prior adv
> > > > 1243 54 67 39
> > > >
> > > > we want
> > > >
> > > > Terminal rating1 rating2 addr prior adv
> > > > 1243 23 34 54 67 39
> >
> > I don't quite understand. These must be rows from 2 different tables
> > since they have different fields. Therefore, why won't a simple join
> > work?
> >
> > Select t1.terminal, rating1, rating2, addr, prior, adv
> > from t1, t2
> > where t1.terminal = t2.terminal
> >
> > Am I missing something?
>
> Yes. The table structure.

I agree. But I assume, from what was given, that there are two tables, one with the row structure:

        Terminal rating1 rating2
the other with the structure:

        Terminal addr prior adv

and that there is a one-to-one correspondence. In this case, a simple join would work. Maybe the original poster could elaborate on the structure of the data.


Jim Lyons                     |  Operating Systems Specialist
OTS                           |  512-471-7414
University of Texas at Austin |  fax: 471-2449
http://www.weblyons.com       |  jlyons@weblyons.com
Received on Thu Jul 04 2002 - 08:38:52 CDT

Original text of this message

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