1个回答
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)
<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)
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询