一定要用SQL啊,用SP行不行,容易得很那
一定用SQL恐怕不易,我认为可是可以,就是一时写不出来,
真的是时间仓促再加上水平有限
算了,兄弟用SP搞定他了

解决方案 »

  1.   

    select max(count) - 
    (select max(count) 
    from tablea 
    where count<(select max(count) from tablea where name = 'reikoo') and name like 'reikoo') from tablea where name = 'seikoo'
      

  2.   

    select aa-ab from 
    (select max(count) aa
    from tableA where name='seikoo') e,
    (select max(count) ab from tableA
    where count < (select max(count) from tableA where name='seikoo') and name='seikoo') d