写了如下语句:
select xl as xl,sum(yye+yp) as yyze from yy_ryye
where rq>='2008-01-01' and rq<='2008-09-25' and xl<>'31' and xl<>'41' group by xl
请教如何在其中取出最大值呢?显示出xl及yyze两项数据?
select xl as xl,sum(yye+yp) as yyze from yy_ryye
where rq>='2008-01-01' and rq<='2008-09-25' and xl<>'31' and xl<>'41' group by xl
请教如何在其中取出最大值呢?显示出xl及yyze两项数据?
解决方案 »
- 怎么老是提示:从数据类型 nvarchar 转换为 float 时出错。
- 文本文件导入问题
- 如何把sql的日期转化成可以存放在oracle日期字段?
- 我的sql2005安装部分是英文的
- 请大家帮我改一个SQL语句好吗?
- 这条SQL语句该如何写?
- 请大家帮忙看看这个SQL语句该怎么写?
- 怎样用INSERT语句插入包含"'"'""''%^&*&特殊字符的数据
- 用sql 语句 在ACCESS 里怎么样才能设置主键及 默认值???
- sql server 的 sp 循环嵌套 和 游标 使用的问题 .... ?
- 怎么restore另一台服务器上的backup
- 大家好:请帮忙看看这个简单的sql语句怎么实现?谢谢
where rq>='2008-01-01' and rq <='2008-09-25' and xl <>'31' and xl <>'41'
group by xl
order by 2
where rq>='2008-01-01' and rq <='2008-09-25' and xl <>'31' and xl <>'41' group by xl
where rq>='2008-01-01' and rq <='2008-09-25' and xl <>'31' and xl <>'41'
group by xl
order by 2 desc
where rq>='2008-01-01' and rq <='2008-09-25' and xl <>'31' and xl <>'41' group by xl ) as yy_ryye_tmp
order by yyze desc