DB Query exclude duplicates, returning only the newest
You can use range() to limit your results

$query = db_select('updates_summary', 'n')
-&gt;fields('n', array('upid', 'name', 'date','previous_version','new_version'))
-&gt;orderBy('date', 'DESC')-&gt;range(0,1);
$query = $query-&gt;execute(); 
return $query;