select fp.id, count(l.id) as lans 

from d_forma_pagamentos fp 

join d_lancamentos l on (l.forma_pagamento_id=fp.id and l.estorno=0 and l.descricao not like '%$$$%')

group by fp.id

having lans > 2