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 |
|
Delinda
Constraint Violating Yak Guru
315 Posts |
Posted - 2010-02-21 : 10:39:40
|
| My table and row as follows,coutTID | RID | Cout | Seq | Stat | Remk-------------------------------------------------------------------_d091100008882 _r00000007 KL 1 A NULL_d091100008882 _r00000007 JB 2 A NULL_d091100008882 _r00000007 SG 3 A NULL_d091100008930 _r00000024 JB 1 A NULL_d091100008930 _r00000024 KL 2 A NULL_d091100008930 _r00000024 KLANG 3 A NULL_d091100007971 _r00000007 KL 1 A NULLi want my resultset as follow,TID | NoOfTID | RID ----------------------------------------------------------------_d091100008882 3 _r00000007 _d091100008930 3 _r00000024 _d091100007971 1 _r00000007 how to count(TID)? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-21 : 10:46:06
|
| [code]SELECT TID,RID,COUNT(*) AS NoOfTIDFROM tableGROUP BY TID,RID[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
Delinda
Constraint Violating Yak Guru
315 Posts |
Posted - 2010-02-21 : 10:54:23
|
| tq sir. my problem is not understand how to using group by |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-21 : 10:56:59
|
quote: Originally posted by Delinda tq sir. my problem is not understand how to using group by
sorry didnt get youdid you mean this is not what you want?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2010-02-21 : 14:58:11
|
quote: Originally posted by visakh16
quote: Originally posted by Delinda tq sir. my problem is not understand how to using group by
sorry didnt get youdid you mean this is not what you want?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
No...I guess OP said he did not know how to use GROUP BY...but now he does. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-22 : 08:09:37
|
quote: Originally posted by vijayisonly
quote: Originally posted by visakh16
quote: Originally posted by Delinda tq sir. my problem is not understand how to using group by
sorry didnt get youdid you mean this is not what you want?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
No...I guess OP said he did not know how to use GROUP BY...but now he does. 
Oh I see ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|