How to get each db result value count How to get values count in db_select
My query is:

$last_item = '2015-07-19';
$query = db_select('field_data_appointment_date','ap');
$query-&gt;join('field_data_appointment_slot','aps','aps.entity_id = ap.entity_id');
$query-&gt;fields('aps',array('appointment_slot_value '));
$query-&gt;condition('ap.appointment_date_value', '%' . db_like($last_item) . '%', 'LIKE');
$result = $query-&gt;execute()-&gt;fetchAll(PDO::FETCH_ASSOC);
dsm($result);


and my result is:

... (Array, 4 elements)
0 (Array, 1 element)
appointment_slot_value (String, 11 characters ) 10.00-11.00
1 (Array, 1 element)
appointment_slot_value (String, 11 characters ) 10.00-11.00
2 (Array, 1 element)
appointment_slot_value (String, 11 characters ) 10.00-11.00
3 (Array, 1 element)
appointment_slot_value (String, 11 characters ) 11.00-12.00


I need result like count of 

:10.00-11.00 is 3
:11.00-12:00 is 1


Anyone help me out
Not fully understanding the output you really want to achieve, but here's examples on how to count the results coming from the database

get count with db_select

OR

rowCount

Let me know if any of those work for you.