all groups > sql server mseq > july 2003 >
You're in the

sql server mseq

group:

Query using distinct, top 5, sorting


Query using distinct, top 5, sorting Casey
7/29/2003 12:26:19 PM
sql server mseq: I am trying to run a query like the following:

set rowcount 5
Select distinct col0 from tab0 where date between 'date1'
and 'date2'
sort by count(instances of returns in select statement)

While this is a little oversimplified, I am trying to
select all distinct rows, sort them by most to least and
limit the returned rows to 5.

MySQL has a function called "limit" where I could do this
much easier, is there an easy way to accomplish this in
MSSQL?

Thanks,
Re: Query using distinct, top 5, sorting Anith Sen
7/29/2003 2:56:31 PM
See responses in .programming

--
- Anith
( Please reply to newsgroups only )

AddThis Social Bookmark Button