BlockTmGet.sql 887 B

123456789101112131415161718192021222324252627
  1. /* syntax version 1 */
  2. pragma UseBlocks;
  3. insert into @t
  4. select
  5. cast(ftztimestamp as TzTimestamp) as `tm`,
  6. from Input;
  7. commit;
  8. SELECT
  9. DateTime::GetYear(tm) as ryear,
  10. DateTime::GetDayOfYear(tm) as rdayofyear,
  11. DateTime::GetMonth(tm) as rmonth,
  12. DateTime::GetMonthName(tm) as rmonthname,
  13. DateTime::GetWeekOfYear(tm) as rweekofyear,
  14. DateTime::GetWeekOfYearIso8601(tm) as rweekofyeariso8601,
  15. DateTime::GetDayOfMonth(tm) as rdayofmonth,
  16. DateTime::GetDayOfWeek(tm) as rdayofweek,
  17. DateTime::GetDayOfWeekName(tm) as rdayofweekname,
  18. DateTime::GetHour(tm) as rhour,
  19. DateTime::GetMinute(tm) as rminute,
  20. DateTime::GetSecond(tm) as rsecond,
  21. DateTime::GetMillisecondOfSecond(tm) as rmsec,
  22. DateTime::GetMicrosecondOfSecond(tm) as rusec,
  23. DateTime::GetTimezoneId(tm) as rtz,
  24. DateTime::GetTimezoneName(tm) as rtzname
  25. FROM @t;