Link to home
Start Free TrialLog in
Avatar of cafferm
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
Avatar of sajuks
sajuks

//r u asking for this ?
select count(*),logtype
from tablename
group by logtype
ASKER CERTIFIED SOLUTION
Avatar of sajuks
sajuks

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cafferm

ASKER

Thats it thanks