求教oracle 数据库 字段求和语句
oracle数据库中某数据库weight表的Netweight字段为货物的净重数,我想求所有记录netweight合计数,请问语句怎么写?...
oracle 数据库中某数据库weight表的Netweight 字段为货物的净重数,我想求所有记录netweight合计数,请问语句怎么写?
展开
6个回答
展开全部
select t.bm,
(select count(*) from a where a.zl1=1 and a.bm=t.bm group by a.bm) as zl1,
(select count(*) from a where a.zl1=2 and a.bm=t.bm group by a.bm) as zl1,
(select count(*) from b where b.bm=t.bm group by b.bm) as qt
from a tclwyzx希望有所提示,有空到51cto,365testing进一步交流!
(select count(*) from a where a.zl1=1 and a.bm=t.bm group by a.bm) as zl1,
(select count(*) from a where a.zl1=2 and a.bm=t.bm group by a.bm) as zl1,
(select count(*) from b where b.bm=t.bm group by b.bm) as qt
from a tclwyzx希望有所提示,有空到51cto,365testing进一步交流!
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select t.bm,
(select count(*) from a where a.zl1=1 and a.bm=t.bm group by a.bm) as zl1,
(select count(*) from a where a.zl1=2 and a.bm=t.bm group by a.bm) as zl1,
(select count(*) from b where b.bm=t.bm group by b.bm) as qt
from a thello希望对你有帮助。更多到
(select count(*) from a where a.zl1=1 and a.bm=t.bm group by a.bm) as zl1,
(select count(*) from a where a.zl1=2 and a.bm=t.bm group by a.bm) as zl1,
(select count(*) from b where b.bm=t.bm group by b.bm) as qt
from a thello希望对你有帮助。更多到
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select sum(netweight) “净重合计” from weight;
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
sun(字段名称)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select sum(netweight) from weight
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询