SELECT *
FROM `cdr`
GROUP BY `linkedid`
HAVING MIN(`sequence`)
usort($array['items']['nodes:item'], function($a, $b) {
if ($a['node:value'] === $b['node:value']) {
return 0;
}
return $a['node:value'] > $b['node:value'] ? -1 : 1;
});