本帖最后由 wo6925371 于 2010-04-21 14:35:38 编辑

解决方案 »

  1.   

    select rownum=row_number()over(order by getdate()),* from tb
    --tb 为已查询结果
      

  2.   

    select *,id=(select count(1)+1 from tb where user_id<a.user_id)
    from tb a
      

  3.   

    select * from t_user where user_id <> 'root'这句中的<>什么意思??
    <> 是不等于 和 != 是一样的
      

  4.   

    select
     *,id=(select count(1)+1 from tb where [user_id]<=t.[user_id])
    from
     tb t
      

  5.   

    能不能给解释一下这条语句??select *,id=(select count(1)+1 from tb where user_id<a.user_id)
    from tb a
      

  6.   

    select *,id=(select count(1)+1 from tb where user_id<a.user_id)
    from tb a这句什么意思??  select count(1)+1 
      

  7.   


    求自查询中user_id比外面tb表小的user_id的数量
      

  8.   

    select count(1)+1 from tb where user_id<a.user_id
    这句还是不太明白 where user_id<a.user_id  是怎么比大小的  为什么把这句去了  id的值就全是7了  不去id的值就是123456