$query = "SELECT CLI.* FROM Clientes AS CLI INNER JOIN Procesos AS PRO ON PRO.id_cliente = CLI.id_cliente ORDER BY PRO.Estado";