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 |
|
t0ze
Starting Member
10 Posts |
Posted - 2010-11-22 : 10:54:59
|
| Hello,Can someone help me with this one? I've this table*TABLE 1*Email | Actionxpto1@x.com | Deletexpto1@x.com | Deletexpto1@x.com | Updatexpto1@x.com | Updatexpto1@x.com | Updatexpto2@x.com | Updatexpto2@x.com | Updatexpto3@x.com | Newxpto3@x.com | NewWhat i need to do to get distinc e-mail's with the count of each action for exampleEmail | Action |Countxpto1@x.com | Delete | 2xpto1@x.com | Update| 3xpto3@x.com | New | 3 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-11-22 : 10:57:33
|
select Email,Action,count(*) as [Count]from YourTable group by Email,Action No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
t0ze
Starting Member
10 Posts |
Posted - 2010-11-22 : 11:14:00
|
| thanks a lot webfred! ^^ |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-11-22 : 11:18:34
|
welcome  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|