select room_id,count (distinct(patient_id)) as patient_id
from patient_flow where time='CURRENT_TIME';
I need the number of patients ids with corresponding room_ids at the current time.
id | patient_id | room_id | time
----+-------------+---------+---------------------
1 | 00035-67351 | 1 | 2015-06-09 10:11:20
1 | 00035-67351 | 2 | 2015-06-09 10:31:20
1 | 00035-67351 | 1 | 2015-06-09 10:12:20
1 | 00035-67351 | 1 | 2015-06-09 10:12:40
1 | 00035-67351 | 1 | 2015-06-09 10:15:40
1 | 00035-67351 | 1 | 2015-06-09 10:30:40
1 | 00035-67351 | 2 | 2015-06-09 10:32:40
1 | 00035-67351 | 2 | 2015-06-09 10:36:40
1 | 00035-67351 | 2 | 2015-06-09 10:38:40
1 | 00035-67351 | 2 | 2015-06-09 10:50:40
I wrote the query above, but it does not execute.