add query aggregate