LEFT join should be after the total query