Skip to content

Instantly share code, notes, and snippets.

@y56
Created August 11, 2020 09:52
Show Gist options
  • Save y56/f15ea575d53bf13c9c929ab2c2c33a13 to your computer and use it in GitHub Desktop.
Save y56/f15ea575d53bf13c9c929ab2c2c33a13 to your computer and use it in GitHub Desktop.
select * from
(
select date_add('millisecond', (t3.i*1000 + t2.i*100 + t1.i*10 + t0.i), TIMESTAMP '1981-12-31 23:59:59.5') mytime from
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3
)
mytime
-----------------------
1981-12-31 23:59:59.997
1981-12-31 23:59:59.998
1981-12-31 23:59:59.999
1982-01-01 00:30:00.000
1982-01-01 00:30:00.001
1982-01-01 00:30:00.002
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment