Consolidate Task SQL