--表如下:
c1,c2,c3--结果如下:
求用一条语句获得c2=1或c3=1时各10条记录

解决方案 »

  1.   

    select top(10)* from TB where c2=1
    union all
    select top(10)* from TB where c3=1
      

  2.   

    select top(20)* from TB where c2=1 or c3=1
      

  3.   

    哎呀,打错字,SORRY,不是“或” 是 “和”
    取【c2=1】 10条记录和取【c3=1】 10条记录
      

  4.   

    select top(10)* from TB where c2=1 and c3=1