
August 10th, 2005, 09:39 PM
|
|
Contributing User
|
|
Join Date: Dec 2004
Posts: 103

Time spent in forums: 13 h 44 m 16 sec
Reputation Power: 4
|
|
|
Selecting the largerst doulbe
I've got an assignment which wants me to select the alrgest count of a certain entity.
I've got a table of reserve books and I have to select the book that was reserved most. I can easily calculate the total reserves for each book, but how the hell do I select the largest?!
Code:
select
call_number, count(call_number)
from
reserve
where
to_char(reserve_date, 'DD-Mon-YY') like '%Jul%'
group by
call_number;
I.e. all I'm interested in are the call_number and their count.
♀Call Number COUNT(CALL_NUMBER)
-------------------- ------------------
AML-3C60 2
AML-3C62 1
AML-3C63 1
AML-3C65 1
is the answer I get.
It's oviousl that the top one's the book with the highest count.
The question is, how do I get just that tuple?
|