Re: I need help on my new homework assignment it should be simpole for expieranced users

From: Tony Hunt <tonster_at_bigpond.net.au>
Date: Fri, 21 Sep 2001 10:40:48 GMT
Message-ID: <QOEq7.76712$bY5.366010_at_news-server.bigpond.net.au>


Something along the lines

SELECT MAX(a.empid), MAX(b.empid)
FROM emp a, emp b
WHERE b.empip NOT IN (SELECT empid FROM emp GROUP BY salary HAVING MAX(salary))

"Zero_Cool" <tex___ass_at_hotmail.com> wrote in message news:417312e0.0109201236.465a916a_at_posting.google.com...
> hi all,
>
> ok here is my problem I need to get the two highest paid employees
> frolm a table
> without using a union I'm not sure but someone told me there is a
> function or something that will return a certain amount of rows from a
> group function like max(salary) but instead of getting just the max it
> would return like the top 2 or whatever is needed
> 1. Is there such a function?
> 2. If so what is the syntax?
> 3. Could you please leave me an example?
>
> man, I can not find anything like this anywhere any help would be
> appreciated and if it is not to much trouble could i ask someone to
> E-mail me anything realated
> thanx in advance
Received on Fri Sep 21 2001 - 12:40:48 CEST

Original text of this message