Drupal 7 views - sort results after they have been retrieved from database just before they are rendered Drupal 7 views - sort results after they have been retrieved from database just before they are rendered.
Here what type of hook need to use.Is the below hook usefull?
hook_views_data_alter()

Thanks,
Ramesh Babu G.
You can implement hook_views_pre_render(&amp;$view) within a custom module and manipulate the result array available in $view->result:

/**
 * Implementation of hook_views_pre_render()
 *
 * @param view $view
 */
function YourModuleName_views_pre_render(&amp;$view) {
  // Check if this is the view and display you want to manipulate
  // NOTE: Adjust/Remove the display check, if you want to manipulate some/all displays of the view
  if ('YourViewName' == $view-&gt;name &amp;&amp; 'YourDisplayName' == $view-&gt;current_display) {
    // EXAMPLE: Just reverse result order
    // TODO: Replace with your desired (re)ordering logic
    $view-&gt;result = array_reverse($view-&gt;result);
  }
}