当前位置:首页 » 数据仓库 » 数据库数据合计
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

数据库数据合计

发布时间: 2022-10-01 00:15:08

‘壹’ sql数据库操作合计问题

借用一楼的查询语句,他查出来是一条数据,这是个首行首列的,然后用把这个值提出来,控件赋值就行了,比如控件是lable,即就是 label1.Text=(此处放那个值)。我也不知道是不是你的那个意思,如果觉得对着,代码方面有问题,可以继续追问,如果意思不对你的那个,那就爱莫能助了。

‘贰’ access中怎样让表格中的数据自动求和

1、打开一个Access数据库软件,可以看到数据库左边的文件目录,鼠标左键单击【表格】选项。

‘叁’ SQL数据库求和

select 姓名 as 姓名,max(case 课程 when'语文' then 分数 else 0 end)语文,max(case 课程 when'数学' then 分数 else 0 end)数学,max(case 课程 when'物理' then 分数 else 0 end)物理 from tb group by 姓名
union all
select '' 姓名 ,sum(语文),sum(数学),sum(物理) from (
select 姓名 as 姓名,max(case 课程 when'语文' then 分数 else 0 end)语文,max(case 课程 when'数学' then 分数 else 0 end)数学,max(case 课程 when'物理' then 分数 else 0 end)物理 from tb group by 姓名
) a

‘肆’ asp 从数据库提取出数据后如何合计

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
sql="SELECT * from td_jd_cx"
rs.open sql,conn,1,1
%>
<%
set rs1=server.createobject("adodb.recordset")
sql="SELECT * from td_jds"
rs1.open sql,conn,1,1
%>
<%
set rs2=server.createobject("adodb.recordset")
sql="SELECT * from td_mr_cx"
rs2.open sql,conn,1,1
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style type="text/css">
<!--
@import url("emx_nav_left.css");
-->
</style>
<link href="emx_nav_left.css" rel="stylesheet" type="text/css" media="all" />
<style type="text/css">
<!--
.STYLE1 {font-weight: bold}
body {
background-image: url(images/4296762_091712076313_2.jpg);
}
-->
</style>
</head>
<body>
<div id="pagecell1">
<div id="pageName">
<h2>团队业绩一览表</h2><%response.write now()%>
</div>
<table width="100%" border="1">
<tr>
<th class="storyLeft" scope="row">序号</th>
<td bgcolor="#CCCCCC" class="storyLeft">团队</td>
<td bgcolor="#66CCFF" class="storyLeft"><strong>当日</strong></td>
<td bgcolor="#00CCFF" class="storyLeft">百分比</td>
<td class="storyLeft">阶段任务</td>
<td class="storyLeft">阶段数</td>
<td class="storyLeft">百分比</td>
<td class="storyLeft">全年任务</td>
<td class="storyLeft">全年数</td>
<td class="storyLeft">百分比</td>
</tr>
<tr>
<%
'***********************************
'整体来说不知道你这个是怎么合计的,所以只是给个想法
'***********************************
'定义一些变量
dim dlCount,dlljCount '当日量统计,当日累计统计变量
dlCount = 0
dlljCount = 0
'这个百分比我不知道怎么取得的自己定义吧

do while not rs.eof
'进行累计一下
dlCount = dlCount + rs("td_m")
dlljCount = dlljCount + rs("当日累计")
%>
<th scope="row"><%=rs("td_id")%></th>
<td bgcolor="#CCCCCC"><%=rs("td_m")%></td>
<td bgcolor="#66CCFF"><strong><%=rs("当日累计")%></strong></td>
<td bgcolor="#00CCFF"><% response.write int(rs("完成比例")*10000)/100 %>%</td>
<td><%=rs1("td_jds")%></td>
<td><%=rs1("阶段累计")%></td>
<td><% response.write int(rs1("完成比例")*10000)/100 %>%</td>
<td><%=rs2("td_zs")%></td>
<td><%=rs2("阶段累计")%></td>
<td><% response.write int(rs2("完成比例")*10000)/100 %>%</td>
</tr>
<%
rs.movenext
rs1.movenext
rs2.movenext
loop
%>

<tr>
<th colspan="2" scope="row">合计</th>
<td><%=dlCount%> </td>
<td> <%=dlljCount%></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</body>
</html>
<%
rs.close
rs1.close
rs2.close
set rs=nothing
set rs1=nothing
set rs2=nothing
conn.close
set conn=nothing
%>
肯定能实现,加一个判断就行了,如果为空就不想加就是了

‘伍’ mysql数据库有两列数据,怎么求和,具体看详情!

select sum(case b is null when a else b end) from table;

‘陆’ SQL数据库里的求和语句怎么写

用select sum(列名),sum(列名),sum(列名)…… from 表 where 条件。

‘柒’ asp 从数据库提取出数据后如何合计

代码一堆没细看,提个意见:直接在sql里面:select count(*) from ... ....(记录行数)
select sum(成绩) from ... ....(求总成绩)

‘捌’ 怎么把两列的数据求和(先每列求和,再把结果再相加)sql数据库

1、在数据中打开一个存在整数数值的表,然后可以看到右下角就有查看的表格数据。

‘玖’ 如何用sql语句将数据库表中字段内容中的数值进行求和

我把逻辑算法告诉你 ,语句你就自己写了。用replace函数 去掉对应的字符
例如:select replace(replace(字段,'尊敬……金额',''),'元……变化','')
使用两次REPLACE 第一次去掉前面的字符,第二次去掉后面的字符,只剩下数字了,再格式化这串数字为数值,不然语句出来只是个字符串