易截截图软件、单文件、免安装、纯绿色、仅160KB

论坛里看到的一个SQL问题及解答

问题:
有一个分数表
id classid,score
1  01    120
2  01    128
3  02    98
4  04    134
5  04    78
现在要统计 各班score >120,和大于90分的人数
达到如下效果
classid >120 >90
01    10    29
02    9      32
03    0      20
答案:
select
classid,
sum
(
case
when
score
>
120
then
1
else
0
end
)
as
[
>120
]
,
sum
(
case
when
score
>
90 and score <=120
then
1
else
0
end
)
as
[
>90
]
from
tb
group
by
classid


相关文档:

MyEclipse连接SQL Server 2000错误排除

在连接SQL Server 2000数据库时,系统提示如下错误:
在网上寻找到处理方法:
(把SQL server update到sp4)
1、在查询分析器中输入 select @@version 并执行
SQL Server 2000 版本和级别
@@VERSION
产品级别
 
SQL Server 2000 原始版本
8.00.194
RTM
 
Database Components SP1
8.00.384
SP1 ......

SQL SERVER 2005 页面文件头部结构

       Next up in the Inside the Storage Engine series is a discussion of page structure. Pages exist to store records. A database page is an 8192-byte (8KB) chunk of a database data file. They are aligned on 8KB boundaries within the data files, starting at byte-offset ......

Oracle SQL*Loader数据装载

SQL*Loader 用于将大量数据装入数据库。
⑴、定宽数据
创建数据文件control.txt:
aaa,bbb
ccc,ddd
eee,fff
创建控制文件control.ctl:
load data
infile 'c:\loader.txt'
append
into table tester.mm(
m1 position(1:3) char,
m2 position(5:7) char)
批量加载数据:
sqlldr tester/test control=c:\loade ......

性能监控之监控SQL语句(ZT)

1.监控当前数据库谁在运行什么SQL语句
SELECT osuser, username, sql_text from v$session a, v$sqltext b
where a.sql_address =b.address order by address, piece;
 
2.分析表
analyze table tablename compute statistics for all indexes;
analyze table tablename compute statistics for all indexed col ......

sql server 2005安装过程中遇到的一些问题

安装的组件和版本的信息
Microsoft SQL Server Management Studio      9.00.1399.00
Microsoft Analysis Services 客户端工具      2005.090.1399.00
Microsoft 数据访问组件 (MDAC)      6.1.7600.16385 (win7_rtm.090713 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号