Re: First two maximum and minimum value

From: Bronislovas Balvocius <bronius_at_nafta.lt>
Date: Mon, 22 Jul 2002 15:03:57 +0200
Message-ID: <3d3c02a9_at_news.takas.lt>


This will work only with Oracle 8.1.xx and later, because of the different ROWNUM assignment policy, won't it? Bronislovas
  "JC" <jean.jr_at_videotron.ca> wrote in message news:wzF 8.3581$364.203354_at_weber.videotron.net...   Try something like this :

  SELECT
    MAXIMUM.NAME
  FROM
  (
    SELECT
      NAME
    FROM
      EMP
    ORDER BY
      SALARY ASC
  ) MAXIMUM
  WHERE
    ROWNUM <= 2

  UNION ALL   SELECT
    MINIMUM.NAME
  FROM
  (
    SELECT
      NAME
    FROM
      EMP
    ORDER BY
      SALARY DESC
  ) MINIMUM
  WHERE
    ROWNUM <= 2

  JC

  "Leader" <sohelcsc_at_yahoo.com> wrote in message news:b1a93c73.0207200516.57fe8f94_at_posting.google.com...
> Hi All,
>
> I have a table(suppose emp table) From there i need to select First
> two persons salary who get maximum salary. and two persons salary
 who
> get minimum salary.
> Can anyone pls help me..
>
>
> Thanks
> hoque

--
Received on Mon Jul 22 2002 - 15:03:57 CEST

Original text of this message