select * from table where client_id='xxxxxxxxxxx' order by cur_time desc
================================================================CSDN 论坛助手 Ver 1.0 B0402提供下载。 改进了很多,功能完备!★  浏览帖子速度极快![建议系统使用ie5.5以上]。 ★  多种帖子实现界面。 
★  保存帖子到本地[html格式]★  监视您关注帖子的回复更新。
★  可以直接发贴、回复帖子★  采用XML接口,可以一次性显示4页帖子,同时支持自定义每次显示帖子数量。可以浏览历史记录! 
★  支持在线检测程序升级情况,可及时获得程序更新的信息。★★ 签名  ●  
     可以在您的每个帖子的后面自动加上一个自己设计的签名哟。Http://www.ChinaOK.net/csdn/csdn.zip
Http://www.ChinaOK.net/csdn/csdn.rar
Http://www.ChinaOK.net/csdn/csdn.exe    [自解压]

解决方案 »

  1.   

    select * FROM TEMP WHERE client_id  ='xxxxxxxxxxx' AND
    CUR_TIME=(SELECT MIN(CUR_TIME) FROM TEMP WHERE client_id  ='xxxxxxxxxxx' )
      

  2.   

    select value from table where client_id='xxxxxxxxxxx' and cur_time=max(cur_time)
      

  3.   

    select value from temp
    where client_id  ='xxxxxxxxxxx' and 
          cur_time = ( select max(cur_time) from temp
                       where client_id  ='xxxxxxxxxxx' );
      

  4.   

    收回我的答案,同意hdkkk(diablo2)
      

  5.   

    to bowlder(玩石):
      你将返回很多条记录,我只需要一条。
      

  6.   

    最优化的方法应该是根据
    client_id 
    建一个分列簇索引,
    然后再查询。
    这样数据能直接找到你要的记录,而不用大量扫描表数据。
      

  7.   

    select value from temp
    where (id,cur_time)=(
      select id, max(cur_time)
      from temp
      where id='xxxxxxxxx'
      group by id
    )
    -- and rownum<2  --** if you only want 1 row 
    ;
      

  8.   

    to yannankai(难的我不会):
      能更详细一点吗?
      

  9.   

    select client_id,min(cur_time) from temp where client_id='xxxxxxxxxxx' group by client_id;
      

  10.   

    select * from temp where client_id='xxxxxxxxxxx' and rownum=1
    order by cur_time desc
      

  11.   

    我觉得楼上的zhu_liping(zz)兄,很有道理!
    不知有没有更好的?
      

  12.   

    min函数和max函数在这里不能用么?