BlockStartOf.sql 710 B

12345678910111213141516171819202122232425262728
  1. /* syntax version 1 */
  2. pragma UseBlocks;
  3. insert into @t
  4. select
  5. cast(ftztimestamp as TzTimestamp) as `tztimestamp`,
  6. from Input;
  7. commit;
  8. select
  9. DateTime::StartOfYear(`tztimestamp`),
  10. DateTime::StartOfQuarter(`tztimestamp`),
  11. DateTime::StartOfMonth(`tztimestamp`),
  12. DateTime::StartOfWeek(`tztimestamp`),
  13. DateTime::StartOfDay(`tztimestamp`),
  14. DateTime::StartOf(`tztimestamp`, Interval("PT13H")),
  15. DateTime::StartOf(`tztimestamp`, Interval("PT4H")),
  16. DateTime::StartOf(`tztimestamp`, Interval("PT15M")),
  17. DateTime::StartOf(`tztimestamp`, Interval("PT20S")),
  18. DateTime::StartOf(`tztimestamp`, Interval("PT7S")),
  19. DateTime::TimeOfDay(`tztimestamp`)
  20. from @t;