select x.a,x.b.y.c.y.d from
(select max(最大值) as a ,max(发生时刻) as b from 表 group by 最大值) x ,(select min(最小值) as c ,min(发生时刻) as d from 表 group by 最大值)
(select max(最大值) as a ,max(发生时刻) as b from 表 group by 最大值) x ,(select min(最小值) as c ,min(发生时刻) as d from 表 group by 最大值)
解决方案 »
- 求删除mssql重复数据语句
- 建立了远程连接后(用户名,密码都是远端服务器上的sql server验证下的,不是本地的sa),为什么查询时,提示:用户 'sa' 登录失败?
- MSSQL整除+0,非整除+1
- 插入字段的问题
- 怎样取得SQL数据库的路径
- 简单测试,非常的不理解,请大家给指点一下
- 时间差问题
- 如何用命令行得知数据库中有那些表
- 关于SQL SERVER 2000的常见问题,顶者有分!在线等,解决即给分!
- ODBC的ACCESS数据源可以不设的DSN直接用连结字符串,SQL SERVER数据源可不可以,或者如何动态用代码加入新的DSN
- 能不能写一个聚合函数?
- 如何根据已有表,建立完全一样的一个新表?
(select max(最大值) as a ,max(发生时刻) as b from 表 group by 最大值) t1,
(select min(最小值) as c ,min(发生时刻) as d from 表 group by 最大值) t2
from 表OR:select (select max(最大值) from 表),
(select 发生时刻 from 表 where 最大值=(select max(最大值) from 表)),
(select min(最小值), from 表),
(select 发生时刻 from 表 where 最大值=(select max(最小值) from 表))
from 表
FROM table1 a, table1 b
where (a.itemcount1 = (select max(itemcount1) from table1 ))
and (b.itemcount2 = (select min(itemcount2) from table1 ))