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

求一个sql语句。。。 - Oracle / 开发

一共两列
id time
1 201009
2 201009
3 201009
1 201009
1 201009
2 201009
4 201009
求,,某一时间点击量最大的id号?(oracle)
select time,max(id) from tablename
group by time

SQL code:


select id,time,max(id) keep(dense_rank last order by count(*)) 最大id
from tb
where time between t1 and t2
group by id,time





select max(id) from tb where time =某一时间

select id,time from
(
select id,count(id) num,time from table
where time = '某一时间'
group by time,id
order by num desc
)
where rownum =1;

select id from
(
select id,count(id) num,time from table
where time = '某一时间'
group by time,id
order by num desc
)
where rownum =1;

SQL code:

--前面的修正下
SQL> edi
已写入 file afiedt.buf

1 select max(id) keep(dense_rank last order by count(*))
2 from tb
3 where time ='201009'
4* group by id
SQL> /

MAX(ID)KEEP(DENSE_RANKLASTORDERBYCOUNT(*))
------------------------------------------
1







引用

引用 5 楼 adebayor 的回复:

select i


相关问答:

jsp链接sql2000的疑问?



type Exception report


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jas ......

Oracle离线访问---求助 - Oracle / 基础和管理

大家好,我现在把oracle服务器上面的原始文件,下载到本机了.我想在本机访问数据库怎么设置啊.是不是类似可以建立一个什么虚拟服务器来实现.请大家出出主意
引用
    大家好,我现在把oracle服务器上面 ......

求一sql语句 - MS-SQL Server / 疑难问题

现在有两张表:文章主表A(articleId,articleTitle),文章评论表B(commentId,articleId,commentTitle)
现在我想实现这样的功能:列出文章列表,其中每篇文章标题下面列出此文章的前2个文章评论,请问sql语句怎么写啊 ......

求一SQL - MS-SQL Server / 基础类

tab1 字段:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 字段:goodsid,goodskind(商品类型)
tab3 字段:goodskind(商品类型),kindname
结果:
得到商品类型在一段时间 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号