-
C# UseHaving 在HAVING子句中使用子查询过滤平均值数据
C# UseHaving 在HAVING子句中使用子查询过滤数据,查询学生表中学生年龄大于平均学生年龄的学生信息,查询代码的编写如下:string P_Str_ConnectionStr = string.Format(//创建数据库连接字符串
@"server=WIN-GI7E47AND9RLS;database=db_TomeTwo;uid=sa;pwd=");
string P_Str_SqlStr = string.Format(//创建SQL查询字符串
@"SELECT 所在学院,学生姓名,年龄,(SELECT AVG(年龄) FROM tb_Student) AS 平均年龄 FROM tb_Student GROUP BY 所在学院,学生姓名,年龄 HAVING 年龄>(SELECT AVG(年龄) FROM tb_Student)");
SqlDataAdapter P_SqlDataAdapter = new SqlDataAdapter(//创建数据适配器
P_Str_SqlStr, P_Str_ConnectionStr);
DataTable P_dt = new DataTable();//创建数据表
P_SqlDataAdapter.Fill(P_dt);//填充数据表
return P_dt;//返回数据表
请在测试前,连接好数据库,本例只是分享代码,并没有找到数据库文件。
- 2022-03-02 18:15:07下载
- 积分:1
-
MWC
线束加式使用大规模大规模集成电路 非机动车 在此(Circuits Conductor)
- 2011-05-25 01:44:07下载
- 积分:1
-
MapInfo-Tab-to-Shape-File-Tool
MapInfo的Tab文件转化为ArcGIS的Shape文件(MapInfo Tab files to ArcGIS Shape files)
- 2011-10-03 15:35:32下载
- 积分:1
-
quickStartOMAPL1x_rCSL_1.0
平台支持包,可供bios系统支持标准外设驱动(Platform support package for BIOS system to support standard peripheral drivers)
- 2020-06-18 16:00:02下载
- 积分:1
-
字符串加减.c
一段简单的代码实现字符串的加减, 可以用于编程练习(A piece of code which implements the addition and subtraction of a string)
- 2018-03-08 18:20:43下载
- 积分:1
-
Mixture_of_VC_and_Matlab_programming
VC与Matlab的混合编程方法及其应用
详细介绍了VC与Matlab混合编程的方法和实例,适合初步接触混合编程的人使用。(Mixture of VC and Matlab programming and application details of the VC and Matlab programming methods, and case mix for the initial contact with mixed programming to use.)
- 2010-06-12 16:15:04下载
- 积分:1
-
CSharp
rsa md5 des 等各种密码学实验的例子 带有界面(Examples rsa md5 des cryptography and other experiments with the interface)
- 2014-05-18 14:03:22下载
- 积分:1
-
bbbbb
说明: 统计学的一些简单的小程序,希望大家可以帮忙改以下(statistically small number of simple procedures in the hope that we can help with the following)
- 2006-04-19 20:58:11下载
- 积分:1
-
msocudp
微软提供的UDP编程实例代码,实现了客户端向服务端发送数据的功能,服务器端接收并显示。(UDP programming example code provided by Microsoft client functionality to send data to the server, the server-side receiver and display.)
- 2012-09-05 22:12:35下载
- 积分:1
-
C语言图书管理系统
小型的管理系统1000多行的的代码,包含数据的基本操作,增减删除修改等等,现在普通的大学才开始接触C语言的时候就是采用做这种小系统的方式完成训练的,我做的参考一下。
- 2022-11-04 18:35:03下载
- 积分:1