select to_char(
(to_date(20160218, 'yyyymmdd') + (level - 1) / 24),
'yyyymmddhh24'
) dt
from dual
connect by level <= 24
This SQL can run in Oracle but MySQL does not support these hierarchical functions (connect by level
).
How can it be translated to MySQL?