易截截图软件、单文件、免安装、纯绿色、仅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


相关文档:

sql server安装的一个小问题

     以前在安装sql的时候,如此提示,我只要重新启动即可,可是今天重新启动了N次计算机,问题却丝毫没有解决,依然提示这样的话。“以前的某个程序安装已在安装计算机上创建挂起的文件操作。运行安装程序之前必须重新启动计算机。” 只好google以下,最终得知是安装程序在先前的安装过程中 ......

获取SQL Server服务器列表的几种方法

一、 SQL DMO 描述:SQL Distributed Management Objects(SQL分布式管理对象),存在于SQLDMO.dll文件中,实际上是一个COM 对象,通过调用SQL DMO的ListAvailableSQLServers方法取得。 列表类型:列举装有“客户端”和“服务端”的计算机。 适用条件:装有 SQL Server,且有SQLDMO.dll文件。 速度:中 调用示例:GetS ......

性能监控之监控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号