Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Aggregate Function

Author  Topic 

gosavipriyanka
Starting Member

1 Post

Posted - 2011-07-19 : 02:49:59
Hi

I have a problem regarding the aggregate function.

I want to display the count as well as row's data.how can i do that.

I have BookType where i want to display the The Book's Records acording to the bookType.
means in grid i have to show the data like

Name Of Book Quantity Type
Physics 10 Physics
Chemistry 5 Chemistry

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-07-19 : 02:51:38
Please give us table structure, example data and wanted result.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

sayan751
Starting Member

4 Posts

Posted - 2011-07-26 : 01:24:52
it should be something like this :

select NameOfBook,Count(*) as Count, TypeOfBook from Books group by NameOfBook,TypeOfBook
Go to Top of Page
   

- Advertisement -