一种解决方案是使用包含您的时间片的助手表。
FromHour和ToHour只是字符串
TABLE timesliceID | FromHour | ToHour | NextDay---+----------+--------+-------1 | 00:30 | 01:30 | 02 | 01:30 | 02:30 | 0<snip>24 | 23:30 | 00:30 | 1select date(date) aDate, ID ,date, bidOpen, max(bidHigh),min(bidLow)from data inner join timeslice ON date >= CONCAt(date(Date),' ',FromHour) and date < concat(date(DATEADD(day,NextDay,date),' ',ToHour)group by aDate, ID
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)