select col001,col002=sum(col002) from 表A group by col001