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: Top-N records.

RE: Top-N records.

From: Sam P. Roberts (ZADCO ITIS) <roberts_at_zadco.co.ae>
Date: Tue, 16 Jan 2001 07:58:51 +0400
Message-Id: <10742.126726@fatcity.com>


Puri
I fail to see why people comment with arrogance like "was not impressed by anyone", that's like a red flag to a bull, and even though it wasn't an insult at me, it deserved some comment. Your answer was indeed correct in one instance - big deal ,the top-N question, doesn't every DBA deal with it in kindergarten- duh. Anyhow, other people had also given the correct comments in the list before you.

why don't you learn a lesson Puri and don't be so demeaning to fellow professionals.

p.s. I apologize to rest of list for my tone, I don't want to start a protracted row, I will comment no more.

Sam

-----Original Message-----
From: Sachin Puri [mailto:sachin_at_siworldwide.com] Sent: Monday, January 15, 2001 3:21 PM
To: Multiple recipients of list ORACLE-L Subject: RE: Top-N records.

Roberts

I think u haven't read my whole comment.After the query i have said that if distinct salaries
are required then "distinct clause" have to be used. What do you say now.I fail to understand why people try to comment without reading the whole
article .
I think Mr Sam Roberts this is for you to learn a lesson.

Rgds,
Sachin Puri

-----Original Message-----
Sent: Monday, January 15, 2001 11:15 AM
To: Multiple recipients of list ORACLE-L

Sachin,

This is only partially right depending on your interpretation of the question. If the top salary is 100,000 dollars and 50 people have that salary - your answer will bring back all 50 people - thats not top 20

Sorry matey, I'm not too impressed with your answer also

Sam Roberts

-----Original Message-----
Sent: Monday, January 15, 2001 8:00 AM
To: Multiple recipients of list ORACLE-L

Aldi
I just saw this topic today. I also saw comments of various dbas regarding your query but was
not impressed by anyone.
You can successfully use this query and i bet this will not give you any problems:

select salary from employee x where 20 > (select count(*) from employee y where y.salary > x.salary) order by x.salary desc;

However if the u want to have top 20 distinct salaries then add distinct clause.

Sachin Puri
Oracle Development and Administration
Solutions Infosystems

-----Original Message-----
Sent: Saturday, January 13, 2001 2:54 AM To: Multiple recipients of list ORACLE-L

Hi List,

This question has been discussed so many times. But I dont have the trick now.
Could you please send me the trick to select top-20 salary of scott.employee table ?
Thanks.

Aldi



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Aldi Barco
  INET: ipal_at_hotmail.com

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: Sachin Puri
  INET: sachin_at_siworldwide.com

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: Sam P. Roberts (ZADCO ITIS)
  INET: roberts_at_zadco.co.ae
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: Sachin Puri
  INET: sachin_at_siworldwide.com

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 Received on Mon Jan 15 2001 - 21:58:51 CST

Original text of this message

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