Re: SQL
Date: Thu, 10 Dec 1998 22:38:09 -0600
Message-ID: <3670A1B1.1CF74DBB_at_Feist.Com>
This type of problem was just made for 'in-line' views!!! (I LOVE 'EM)
select type, title_cnt from
(select type, count(*) title_cnt
from titles
group by type
)
order by title_cnt desc, type
;
Sandra Calisto wrote:
> Hi!
>
> I'm with a problem! Can you help me?
> Well ... imagine that you have a bookstore database and want to know
> wich type of book (science, literature, etc) has more books!!!
> Well I did the counting ...
> select type, count (titles.type)
> from titles
> group by titles.type
> My prob is ... how do I get the greatest type of book!
> Can you help me, please?
>
> Sandra
Received on Fri Dec 11 1998 - 05:38:09 CET