Sonia - Updated query for null values in max for seqNum