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 |
|
tpiazza55
Posting Yak Master
162 Posts |
Posted - 2010-11-18 : 19:03:34
|
| i have tables account and sub accounti am trying to write a query where i get all the accounts and the count of the subacccountsthe are joined by account.accountid = subaccount.accountidhow do i do this? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
tpiazza55
Posting Yak Master
162 Posts |
Posted - 2010-11-18 : 19:09:35
|
| accountid accountname1 AccountNameSubaccountid SubAccountname SubaccountAccountID1 SubName1 12 SubName2 13 SubName3 1Outputaccountid, accountname, count(subaccount)1 AccountName 3 |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
tpiazza55
Posting Yak Master
162 Posts |
Posted - 2010-11-18 : 19:24:59
|
| thanks |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|