select * from table1 a, table1 b
where a.收付类别 = b.收付类别
and a.费名 = b.费名
and a.金额 = 0 - b.金额

解决方案 »

  1.   

    select * from 表 tem where exists (select 1 from 表 where 金额=-tem.金额 and 收付类别=tem.收付类别 and 费名=tem.费名 )
      

  2.   

    select * from 你的表
      where 金额=-10 and 收付类别='应收' and 费名='卫生费'
      

  3.   

    根据现有记录查询select * from 你的表 a
      ,(select * from 你的表 where 记录查询条件) b
      where a.金额=-b.金额 and a.收付类别=b.收付类别 and a.费名=b.费名
      

  4.   

    select * from 你的表 a
      ,(select * from 你的表 where 记录查询条件) b
      where a.金额=-b.金额 and a.收付类别=b.收付类别 and a.费名=b.费名