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

Asp+sql server问题 - Web 开发 / ASP

我一个项目,有个插入操作,具体是这样的:
我有进货信息表。在出货时选择相应的进货信息,输入数量,选择部门后,点保存按钮,由于网络延时,点一下没有反映,于是用户就又点一下,导致一次插入了两条记录:
例: ......

oracle并发处理SOS - Oracle / 开发

我在开发的这个应用并发性比较高,oracle更新数据时候如何处理并发处理呢?各位大侠发表好的观点啊,在线等待!
oracle数据更新时,会自动默认行锁定,楼主不要操心,Oracle对并行处理已经很成熟了

引用
oracle ......

MS SQL作业问题 - MS-SQL Server / 应用实例

如何在SQL2005中设定定时作业,比如说定时清理某些表的数据,
或者是定时的将某些表的数据导出excel!
在线等待,急急急,最好是详细步骤!
之前我做的作业有点问题!
帮UP

参考:http://hi.baidu.com/toiota ......

oracle初学者你请教 - Oracle / 基础和管理

--建立一个包以定义一个游标
create or replace package PK_test 
as 
type cur_test is ref cursor;
end PK_test;
--建立一个过程,通过输入JOBID,返回一个表记录(游标)!
create or replace ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号