Add agregate sql