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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: ***Problem***

RE: ***Problem***

From: Mark Leith <mark_at_cool-tools.co.uk>
Date: Thu, 01 Feb 2001 06:09:41 -0800
Message-ID: <F001.002A71A9.20010201050541@fatcity.com>

In this case, the rownum should not be a problem when using it in a sub select? You are only trying to get the first seven rows from the sub select.. Whats the problem?

Fair enough, using a rownum on a single select may not be reliable, but in this case it should work like a charm..

-----Original Message-----
K.Karadeniz
Sent: Thursday, February 01, 2001 12:31
To: Multiple recipients of list ORACLE-L

No, No not for this statement , my group leader tells that rownum is not used so much in applications becouse it can give wrong results sometimes. I do not know if it is correct . I ask you for approve him or not..   Thanks
----- Original Message -----
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> Sent: Thursday, February 01, 2001 1:25 PM

paresh mehta,
what was wrong with the sql-statement using <rownum>

It works perfeclty, or am I wrong ??

regards

> Frank Foelz <



Scheidt & Bachmann GmbH
Gestaltung Parkhaussysteme
Breite Strasse 132
41238 Moenchengladbach

Phone : ++49 2166 / 266 - 837
Fax: ++49 2166 / 266 - 615

e-mail :  mailto:Foelz.Frank_at_Scheidt-Bachmann.de
<mailto:Foelz.Frank_at_Scheidt-Bachmann.de>
URL    :  http://www.scheidt-bachmann.de <http://www.scheidt-bachmann.de/>
________________________________________________________________________





-----Ursprüngliche Nachricht-----
Von: Local Folders [mailto:asmika_at_satyam.net.in] Gesendet am: Donnerstag, 1. Februar 2001 08:35 An: Multiple recipients of list ORACLE-L Betreff: ***Problem***

Consider the following case.
TABLE : DEPT

empid             number,
deptid             number,
deptname        varchar2(30)

primary key (empid, deptid)

now i want to fetch first seven records from a cursor whose deptid is maximum
and empid is minimum. kindly let me know how to write this cursor statement.for example.

SQL> select deptid, empid from dept;

 DEPTID EMPID

---------       ---------
        2     94204
        2     94205
        2     94206
        2     94207
        2     94208
        5     94209
        5     94210
        5     94211
        5     94212
        5     94213
        7     94214
        7     94215
        7     94216
        7     94217
        7     94218

15 rows selected.

i want output as following by single query.

 DEPTID EMPID

---------      ---------
        7     94214
        7     94215
        7     94216
        7     94217
        7     94218
        5     94209
        5     94210

7 rows selected

kindly reply.. thanks in advance.

regards
paresh mehta

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Foelz.Frank
  INET: Foelz.Frank_at_Scheidt-Bachmann.de

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Bunyamin K.Karadeniz
  INET: bunyamink_at_havelsan.com.tr

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Mark Leith
  INET: mark_at_cool-tools.co.uk

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Feb 01 2001 - 08:09:41 CST

Original text of this message

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