You should do this using conditional aggregation:
SELECT as1.birthname AS Expr1,
SUM(case when birthyear = 1910 then `count` else 0 end) as yr_1910,
SUM(case when birthyear = 1911 then `count` else 0 end) as yr_1911,
SUM(case when birthyear = 1912 then `count` else 0 end) as yr_1912
FROM AK AS as1
GROUP BY as1.birthname;
I am not sure where gender
and state
come in. These are not included in the outer query, which is probably the cause of your syntax error. You might want to include these in the aggregation:
SELECT as1.birthname, as1.gender, as1.state,
SUM(case when birthyear = 1910 then `count` else 0 end) as yr_1910,
SUM(case when birthyear = 1911 then `count` else 0 end) as yr_1911,
SUM(case when birthyear = 1912 then `count` else 0 end) as yr_1912
FROM AK AS as1
GROUP BY as1.birthname, as1.gender, as1.state;