December 8, 2010 at 1:07 am
SELECT BloggerName,Topic,[Year],Total,
Rank() OVER (Partition by BloggerName Order by Total DESC) as ‘Ranking’
FROM
BlogCount
If i need to count the bloggername by Count() function how would i do it.....can any one please help me.....my query looks very similar to this....
December 8, 2010 at 1:36 am
SELECT BloggerName,Topic,[Year],Total,count(*)
FROM
BlogCount
group by BloggerName,Topic,[Year],Total
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
December 8, 2010 at 10:09 pm
If Bhuvnesh's solution does not work, please provide us a better example of what you are trying to do. Include sample data and table structure. See the article in my signature line for help on creating a helpful thread.
December 9, 2010 at 1:56 am
SELECT BloggerName,Topic,[Year],Total,
Rank() OVER (Partition by BloggerName Order by Total DESC) as 'Ranking',
COUNT(*) OVER(PARTITION BY BloggerName) AS BloggerNameCount
FROM BlogCount;
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply