Simply SQL in ResultController::loadLayout().