query for res with other db session