Update combine query 2 logic