My query is that I have two tables, one called sec_users with the following fields:
sec_users
pk_user, name, dias_disponibles
And anothe
Use SUM aggregating function:
SELECT u.pk_user, sum(u.dias_disponibles) - sum(s.n_diassolicitados) AS dias_libres FROM sec_users u LEFT JOIN solicitud s on s.fk_empleado = u.pk_user GROUP BY u.pk_user
...and always follow tip 1 from comments!