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.
Author |
Topic |
mrtanvirali
Starting Member
41 Posts |
Posted - 2009-04-11 : 03:26:00
|
I've Categories in Category table and some rows in other table, i want to fetch the following result,Category 1 (4) itemsCategory 2 (12) itemsetc. |
|
mrtanvirali
Starting Member
41 Posts |
Posted - 2009-04-11 : 03:49:10
|
its done, i've used group by clause to get the desired result, |
|
|
soorajtnpki
Posting Yak Master
231 Posts |
Posted - 2009-04-11 : 04:42:09
|
hi try like belowselect count(*) as items, s.categoryid from category s inner join items pon s.categoryid =p.categoryid group by s.categoryid ok tanx |
|
|
mrtanvirali
Starting Member
41 Posts |
Posted - 2009-04-11 : 04:49:56
|
thanks for reply sooraj,i've already done, this link helped me (http://www.sqlteam.com/article/how-to-use-group-by-in-sql-server) |
|
|
soorajtnpki
Posting Yak Master
231 Posts |
Posted - 2009-04-11 : 04:53:54
|
ok welcome.... |
|
|
|
|
|