adjust bed no query sql