按编号分组select 编号,sum(数量) from 表 where 条件 group by 编号不分组select sum(数量) from 表 where 条件
select sum(数量) from table_name where condition