Mysql – How to obtain records with a higher amount only in cases where there is duplication in the code field?
I have the following mysql query: SELECT pagos.id, codigo_factura as code, pagos.importe as amount FROM pagos INNER JOIN m_labores p ON (pagos.id_producto = p.id) INNER JOIN maquinas m ON (pagos.id_maquina = m.id) WHERE m.id = 561 AND fecha_registro BETWEEN '2022-10-11…