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: First

Re: First

From: Alan <alan_at_erols.com>
Date: Mon, 16 Aug 2004 15:36:33 -0400
Message-ID: <2ocgm1F4rttdU1@uni-berlin.de>

"Daniel Morgan" <damorgan_at_x.washington.edu> wrote in message news:1091760128.987955_at_yasure...
> Alan wrote:
>
> > "Daniel Morgan" <damorgan_at_x.washington.edu> wrote in message
> > news:1091677677.736929_at_yasure...
> >
> >>Peter Plumber wrote:
> >>
> >>
> >>>Hi,
> >>>
> >>>Does Qracle 9i support a SELECT that returns
> >>>only a subset of the records
> >>>
> >>>something link
> >>>
> >>>SELECT FIRST 1 * FROM tablename
> >>>
> >>>thx
> >>>
> >>>Peter
> >>
> >>Have to confess that I am really disappointed with the responses from
> >>Michel, Hans, Rene, and Turkbear because not one gave the answer I
> >>was going to give. And I was sure as I read through theirs that one or
> >>all of them would have done it first ... so here's mine:
> >>
> >>CREATE TABLE t AS
> >>SELECT object_name
> >>FROM all_objects
> >>WHERE rownum < 81;
> >>
> >>SELECT COUNT(*)
> >>FROM t;
> >>
> >>SELECT *
> >>FROM t
> >>SAMPLE (25);
> >>
> >>Returns 25% of the rows.
> >>
> >>--
> >>Daniel A. Morgan
> >>University of Washington
> >>damorgan_at_x.washington.edu
> >>(replace 'x' with 'u' to respond)
> >>
> >
> >
> > I am disapopinted with all of you. The correct answer is, "There is no
such
> > thing as "first", as tables are (unordered) sets. So, what is it you
> > _really_ need to do?"
>
> Reread the original post. The OP did not ask for the first record. What
> the OP wrote, and I quote, is:
>
> "Does Qracle 9i support a SELECT that returns only a subset of the
records"
>
> The word "FIRST" on occurs in a crude attempt to cobble together some
> pseudocode.
>
> All answers, other than yours, are valid.
>

So, you know (apparently through some psychic ability, or some intuitive knowledge of what was meant with the cobbled pseudocode) what the OP really wanted, and find no need to clarify what the user needs... Terriffic. Tell you what: you start coding, I'll go find out what he really wants. And don't complain when you got it wrong. All I wasted was a few minutes making sure I know what I need to do. Received on Mon Aug 16 2004 - 14:36:33 CDT

Original text of this message

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