select top 1 from title where sid=2 
and timer>(
select timer from title where sid=2 and id=15)
order by timer

解决方案 »

  1.   

    select top 1 * from title where sid=2 
    and timer>(
    select timer from title where sid=2 and id=15)
    order by timer
      

  2.   

    update title set timer='2004-02-12 16:20:19.031'
    from title a join(
    select top 1 sid,id,timer
    from(
    select top 2 sid,id,timer
    from title 
    where sid=2 and id=15
    order by timer desc
    )a order by timer
    )b on a.sid=b.sid and a.id=b.id and a.timer=b.timer
      

  3.   

    要求你的sid+id+timer能唯一确定一条记录.
      

  4.   

    update title
    set timer=dateadd(millisecond,1,timer)
    from title
    where sid=2 
    and timer=(
    select min(timer) from title 
    where sid=2 and timer>(
    select timer from title 
    where sid=2
    and id=15 
    )
    )
      

  5.   

    declare @t datetime
    set @t=getdate()
    select  @t
    select dateadd(ms,1,@t)
                                                           
    /*结果.为什么,是不是毫秒级不好操作---2004-04-29 11:45:40.257(所影响的行数为 1 行)                                                       
    ------------------------------------------------------ 
    2004-04-29 11:45:40.257(所影响的行数为 1 行)
    */
      

  6.   

    update title set timer=timer+1 where timer in(select timer from title where sid=2 and id=15)
      

  7.   

    少写了一个from title应该这样:
    update title set timer=timer+1 from title where timer in(select timer from title where sid=2 and id=15)
      

  8.   

    没有实现,pbsql(风云) 是对了,精确度有限
      

  9.   

    那请问各位高手
    如何:更新2004-02-12 16:20:19.030 
           为2004-02-12 16:20:20.030 
           更新为精确度为秒了。
    是不是update set timer=timer+1 .........
      

  10.   

    update set timer=dateadd(ss,1,timer) .........
      

  11.   

    to(:zjcxc(邹建) ()
    对不起,给你加少分!好像不能再补加了.