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 |
|
sateesh.sqldba
Starting Member
25 Posts |
Posted - 2010-06-22 : 04:27:48
|
| Hello Every ONe plz get me out of thisi have two tables one is having(accuno,accname,usageid)anther ne is having(usageid,usagetype)i want count of accno where usagetype='electricity'and i want to display usagetype,accountname,accountno in select statementplz plz get me out of this thank u somuch in advancesateesh |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-06-22 : 04:43:42
|
| Join the two tables on usageid, Use COUNT(*) to get the counts, put a group by clause on the usagetype and, if necessary a where clause to limit to the usage types you're interested in.--Gail ShawSQL Server MVP |
 |
|
|
|
|
|