Update linking query