Place table query to the right place.