Código SQL
[-]
select first 1 fecha, hora, dato
from tablasensores
where fecha between fecha1 and fecha2 and sensor = 1
union
select first 1 fecha, hora, dato
from tablasensores
where fecha between fecha1 and fecha2 and sensor = 2
union
select first 1 fecha, hora, dato
from tablasensores
where fecha between fecha1 and fecha2 and sensor = 3
Pruba con algo asi. Y sando case o luego lansas la consulta sobre esta misma conculta o usando with.
No tomen esta consulta a ala ligera hay varias consultas. pero se esta usando first 1 Aqui hay muchos beneficios.