Ver originalSELECT ( SELECT COUNT( DISTINCT p.pay_id ) FROM Payments p LEFT JOIN Commissions_Payments AS CP USING (pay_id) LEFT JOIN Commissions AS comm USING (comm_id) WHERE user_id_approver IS NOT NULL AND user_id_payer IS NULL AND comm_payed = 0 ) AS approved