Re: Newbie SQL question (Top 10 values)

From: Colin Lim <limgp_at_singnet.com.sg>
Date: 1996/01/18
Message-ID: <4dkdtg$kp1_at_lantana.singnet.com.sg>#1/1


A generic way of selecting the highest 10 sales values is as follows:

select sales
from table_name a
where 10 >

	(select count(*)
	 from table_names b
	 where a.sales < b.sales)

order by sales desc

Cheers
Colin
limgp_at_singnet.com.sg Received on Thu Jan 18 1996 - 00:00:00 CET

Original text of this message