1
I have a table that contains day, month, year, hour, minute and second. I need to return only the time between 8 and 11 o'clock, but do not want me to return from the 11 o'clock forward Example: 8:01 8:40 9:40 10:02 10:55 11:00 do not want you to return 11:01, 11:10...
SELECT *
FROM oi_fact.metrics_values mv
JOIN oi_fact.dim_date dd ON mv.dtt_id = dd.dtt_id
WHERE dmm_id in (select dmm_id from dim_metric where met_id IN (1136))
and mv.nod_id = 168992
AND mv.dtt_id between '202101010000' AND '202101302300'
AND dd.hour >= 8 and dd.hour <= 11
order by mv.dtt_id;
Something like
dd.hour < 11 OR (dd.hour = 11 and dd.minute = 0 and dd.second = 0)
?– Woss