select * from 表a a
where c='xx' and (select count(*) from 表a where c='xx' and b<=a.b) in(2,4)
order by b

解决方案 »

  1.   

    zjcxc真牛啊,呵呵,佩服,學習
      

  2.   

    select * from 表a a
    where c='xx' and (select count(*) from 表a where c='xx' and b<=a.b) in(2,4)
    order by b
      

  3.   

    誰幫我解釋一下b<=a.b有什麼作用?意義試什麼?
      

  4.   

    应该行的.
    要不再这样试试
    select * from 表a a
    where c='xx' and (select count(*) from 表a where c='xx' and b<=a.b) in(2,4)
    order by bselect * from 表a a
    where c='xx' and (select count(*) from 表a where c=a.c and b<=a.b) in(2,4)
    order by b