pl/sql对表中相同字段求和,并把和放到后面一列

本来的数据如图1,想要实现的是图2,求大神解答用sql语句怎么写... 本来的数据如图1,想要实现的是图2,求大神解答
用sql语句怎么写
展开
 我来答
匿名用户
2017-09-19
展开全部
pl/sql对表中相同字段求和,并把和放到后面一列
<a href="https://www.baidu.com/s?wd=select&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1dBPjT4P1mvPynsnWwhrjR40ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnH64PjRsn104PW63rHDsrjnsn0" target="_blank" class="baidu-highlight">select</a> <a href="https://www.baidu.com/s?wd=left&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1dBPjT4P1mvPynsnWwhrjR40ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnH64PjRsn104PW63rHDsrjnsn0" target="_blank"class="baidu-highlight">left</a>(字段1,2),<a href="https://www.baidu.com/s?wd=sum&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1dBPjT4P1mvPynsnWwhrjR40ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnH64PjRsn104PW63rHDsrjnsn0" target="_blank" class="baidu-highlight">sum</a>(字段2) from 表名 group <a href="https://www.baidu.com/s?wd=by&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1dBPjT4P1mvPynsnWwhrjR40ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnH64PjRsn104PW63rHDsrjnsn0" target="_blank" class="baidu-highlight">by</a> <a href="https://www.baidu.com/s?wd=left&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1dBPjT4P1mvPynsnWwhrjR40ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnH64PjRsn104PW63rHDsrjnsn0" target="_blank" class="baidu-highlight">left</a>(字段1,2)
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式