SELECT * FROM employee E1
WHERE 1 = ( SELECT COUNT( DISTINCT salary )
FROM employee E2
WHERE E1.salary < E2.salary
)
LIMIT 0,10
//an array of some songs I like
$employee = array(
'1' => array('name'=>'Hanzala Subhani', 'job_title'=>'Software Developer'),
'2' => array('name'=>'Safdar Subhani', 'job_title'=>'Software Developer'),
'3' => array('name'=>'Shamsh Jawed', 'job_title' =>'Manager')
);
function sort_employee($a,$subkey) {
foreach($a as $k=>$v) {
$b[$k] = strtolower($v[$subkey]);
}
asort($b);
foreach($b as $key=>$val) {
$c[] = $a[$key];
}
return $c;
}
$employee = sort_employee($employee,'artist');
print_r($employee);