January 13, 2005 at 9:15 am
the data (simplied) look like this:
Name date
AAA 1/1/2005
AAA 1/1/2005
BBB 1/1/2005
CCC 1/1/2005
BBB 1/2/2005
BBB 1/2/2005
I want to see how many unique users in a day. the result should be like
3 1/1/2005
1 1/2/2005
is it possible to achieve that without using cursor?
thanks a lot!!!
January 13, 2005 at 9:22 am
Maybe try something like this:
select count(Name),date from(select distinct Name,date from testing)A group by date
hope that helps.
January 13, 2005 at 9:26 am
Simplified a touch:-
select COUNT(DISTINCT(Name)) FROM
Have fun
Steve
We need men who can dream of things that never were.
January 13, 2005 at 10:48 am
As per Steve's answer.
Easiest way:
select count(distinct(name)), date
from testing
group by date
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply