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 |
|
mrsaif
Starting Member
43 Posts |
Posted - 2008-04-10 : 06:18:47
|
| have a table hits with following fields with sample DataCode: CreatedOn: HitId4 2008-04-01 24 2008-04-01 24 2008-04-02 25 2008-04-02 45 2008-04-02 45 2008-04-02 205 2008-04-03 54 2008-04-03 63 2008-04-04 95 2008-04-04 12____________________________________________________________i want to create a query to get count of the code per day. And Count Having unique HitId__________________________________________________________Code: Date: Total_Count: UniqueHit_Count3 2008-04-04 1 14 2008-04-01 2 14 2008-04-02 1 14 2008-04-03 1 15 2008-04-02 3 25 2008-04-03 1 1------------------------------------------------------------How can i do this to count code per day and uniqueHit count in a single query?I am using sql server 2005.Muhammad Saifullah |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2008-04-10 : 06:22:52
|
| try...select code, createdOn, count(*), count(distinct hitID)from Hitgroup by code, createdonEm |
 |
|
|
|
|
|