Distinct Count


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


Who is Participating?
sajuksConnect With a Mentor Commented:
select count(distinct logid),logtype from table
group by logtype;
//r u asking for this ?
select count(*),logtype
from tablename
group by logtype
caffermAuthor Commented:
Thats it thanks
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.