Prueba esto
Código SQL:
Ver originalSELECT p.num_factura,SUM(p.valor_total) AS subtotal,t1.conteo
FROM pedidos p INNER JOIN
(SELECT num_factura,COUNT(*) conteo FROM pedidos GROUP BY num_factura) t1
ON p.num_factura = t1.num_factura
GROUP BY p.num_factura
HAVING subtotal = 105000
ORDER BY p.num_factura ASC
saludos