By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,377 Members | 1,334 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,377 IT Pros & Developers. It's quick & easy.

how to use top 1

P: 50
i want to retireve the first row for the following query
Expand|Select|Wrap|Line Numbers
  1. select TOP 1 t.vid,max(c) from (select vid,count(*) as c from buys group by vid) t group by t.vid;
bt i get a syntax error near 1...
did i do it wrong
plzzz help
Apr 20 '08 #1
Share this Question
Share on Google+
1 Reply


ganeshkumar08
P: 31
select max(cnt) from
(
select count(*) as cnt
from dbo.TrendCLUBS
group by Club_HomeColor

) a
Apr 21 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.