cafferm
asked on
Distinct Count
Hi
I have a table which holds various details i need to count the amount of times an item appears. But i need to only count the item against 1 id - i think i'm confusing things - so here's what i need
Logid LogType Info
035621 FILEH Log on
035622 FILE Log on
035622 FILE Check Something
035622 FILE Log off
035623 FILEH Log off
035623 FILEH Log on
035624 FILEH Log on
So basically i need to count how many times File and FileH appear against the Logids
So the result i need from this is
Logtype Count
FILE 1
FILEH 3
Thanks
cafferm
I have a table which holds various details i need to count the amount of times an item appears. But i need to only count the item against 1 id - i think i'm confusing things - so here's what i need
Logid LogType Info
035621 FILEH Log on
035622 FILE Log on
035622 FILE Check Something
035622 FILE Log off
035623 FILEH Log off
035623 FILEH Log on
035624 FILEH Log on
So basically i need to count how many times File and FileH appear against the Logids
So the result i need from this is
Logtype Count
FILE 1
FILEH 3
Thanks
cafferm
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thats it thanks
select count(*),logtype
from tablename
group by logtype