sql判断时间是否在两个小时区间内

需要根据时间是夜间还是日间。6点到18点为日间,这个是要写在case when中的,怎么处理可以实现

还得是我💢,(case when to_timestamp(to_char(时间,'HH24:MI:SS'),'HH24:MI:SS')
BETWEEN to_timestamp('06:00:00','HH24:MI:SS') and to_timestamp('17:59:59','HH24:MI:SS') then '日间' else '夜间' end)

case when hour(时间)<=18and hour(时间)>=6 then 白天 else 夜间 end