troubleshooting Question

sql query count distinct

Avatar of Angela4eva
Angela4eva asked on
Microsoft SQL ServerSQL
4 Comments1 Solution641 ViewsLast Modified:
classes      time      agentname
2      8/26/13 6:00      a1
2      8/26/13 6:00      a2
1      8/26/13 6:00      a3
1      8/26/13 6:00      a1
1      8/26/13 6:00      a5
1      8/26/13 6:15      a1
1      8/26/13 6:15      a2
1      8/26/13 6:15      a3
2      8/26/13 6:15      a4
1      8/26/13 6:15      a5
2      8/26/13 6:30      a2
2      8/26/13 6:30      a3
2      8/26/13 6:30      a5



I want to count the distinct agents

so
8/26/13 6:00---4
8/26/13 6:15--5

As you can see there were 5 records for 8/26/13 6:00 but count shows only 4 as they were only 4 distinct agents.
I am using sql server 2000
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros