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

Home -> Community -> Usenet -> c.d.o.misc -> Re: (Newbie) Help with query.

Re: (Newbie) Help with query.

From: Joe Smith <nospam_at_nospam.com>
Date: Thu, 5 Jun 2003 17:40:48 +0200
Message-ID: <bbno96$pvl$1@news-reader13.wanadoo.fr>


Happily, I don't have to do homework anymore. But I don't earn my life making SQL, either.

select A.ts, a, b from A, B where B.ts>A.ts This returns, for each a, all the b for which B.ts>A.ts... I can't limit it with rownum

I've also tried with a subselect:
select A.ts as myts, a, b from A, (select ...) where ... select A.ts as myts, a, b from A, B where A.ts=(select ...)

the problem is that I can't reference myts inside the subselect

Yes, I guess it must be pretty obvious, but it's the first time I face this "obvious" select.
Thanks anyway for answering.

"Karsten Farrell" <kfarrell_at_belgariad.com> wrote in message news:MPG.19490165e03512ad9897ab_at_news.la.sbcglobal.net...
> nospam_at_nospam.com said...
> > Hi,
> >
> > I'm not sure about how to accomplish the following query:
> > Table A
> > ======
> > Date ts
> > Number a
> >
> > Table B
> > ======
> > Date ts
> > Number b
> >
> > I want to show A.ts, a, b , being b the first record (and only the first
> > one) such as B.ts > A.ts
> >
> > Thanks in advance!
> >
> >
> >
> This is so simple, it MUST BE homework. What have you tried so far?
> --
> /Karsten
> DBA > retired > DBA
Received on Thu Jun 05 2003 - 10:40:48 CDT

Original text of this message

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