select trans.* from tr trans.....
where (trans.ID<>0 and trans.Status=@transStatus) and (t.DomainID=4) and t.ID not in                    
      (select top 0 t.ID from .........)sqlserver2008
很困惑 为什么 select top 0 t.ID  , 我测试发现单个表select top 0 t.ID总是空
t.ID not in  (select top 0 t.ID from .........)到底代表什么意思??

解决方案 »

  1.   


    有可能是你写错了!呵呵...ID not in (select top 0 t.ID )就是所有的ID啦...
      

  2.   

    not in  (select top 0 ... -> not in null有点无意义的感觉,可能是和类似where (1=1) and (...之类类似,这种一般平台自动处理时拼接生成的,手工写肯定不会写 not in null了,这不是废话,,,
      

  3.   

    我也觉得 但这是在线系统的   老外的sql   我真么看都觉得有问题 。  给出的建议用表变量 
      

  4.   

    top 0 是为了取数据结构