MySQL Group By depending on other colum value -
i have table :
word id foo 1 foo 1 foo 2 foo 2 foo 1 bar 1 bar 1 bar 4 fio 3 fio 3 fio 4
i want group word, same id,
the reslut should like:
word id count foo 1 3 foo 2 2 bar 1 2 bar 4 1 fio 3 2 fio 4 1
i don't know how proceed, regular group not working
and
group word, id
is not working too. please help.
select word, id, count(*) your_table group word, id
Comments
Post a Comment