in reply to using fetchrow_hashref
You can use an "AS" clause to help there:
SELECT code, sum(number) AS number FROM surname_26 group by code [download]
-- Randal L. Schwartz, Perl hacker Be sure to read my standard disclaimer if this is a reply.