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
caffermAsked:
Who is Participating?
 
sajuksConnect With a Mentor Commented:
//thats
select count(distinct logid),logtype from table
group by logtype;
0
 
sajuksCommented:
//r u asking for this ?
select count(*),logtype
from tablename
group by logtype
0
 
caffermAuthor Commented:
Thats it thanks
0
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.