Adding count SQL function