tags:

views:

30

answers:

1

Hello all,

My Table Structure is:

artist_id category

1 Song

1 Song

1 Song

1 Video

1 Video

Now, my output must be

id category total

1 Song 3

1 Video 2

How this can done by using MYSQL.

+3  A: 

I think this should work (untested):

select artist_id, category, count(*) as total from table group by artist_id, category
bernhardrusch
thanks bern.. it works..
Fero
glad I could help
bernhardrusch