do a sum for each entry in table i got two tables a and b
table a contains some names like cobol, php, cmd and a refnumber

name ref
Cobol 1
php   2
cmd   3
...

table b contains multiple projekts where i used one of table a
like year, mm, and a reference to table a
that means f.e

year mm ref
1982 8  1
1982 4  2
1983 5  3
1983 1  1
1982 6  3
1994 12 1
1995 12 2
1996 6  1
1996 6  2

now i want to know how many month in total (from b) i used one of table a to get a list like

Cobol 27
php   20
cmd   11

Note :sums might be not corret in this example.
An answer provided below made me realize I need to clarify the situation further.
Table a has the ref in a so far not mentioned table c with the content:

id number uses 
1   1      1
2   1      2
3   2      1
4   2      3
5   2      4

So table a (pgojekt) contains each project I've worked on and each entry there has a year and number of month in it. It references an other table for example reflanguages.  In Languages there are the possible languages while reflanguages contains the reference to the language.
I hope this is understandable.
For example in 1982 i did 2 projects (1 and 2)  each with 6 month duration. While Project 1 uses languages 1 and 2, project 2 uses language 3 and 4. In 1983, I did another 12 month project that uses languages 1 and 2 and in 1984 one with 3 month 1 and 2 and one with 4 and 5 and 6.
Now the problem seems that a select name, sum(mm) as you suggested shows all but not the sum for Cobol in all those years, followed by php in all those years, followed by....
if this gets to complicated i can add a db dump.
what i want is a list like written above.
I got it working when specifying the name in a where clause, however I want it for all names in table a as shown above
How can this be achieved with MySQL?
Something like the following (untested) should do what you want:
select name, sum(mm)
from a join b using (ref)
group by name;