SplitMake.sql 790 B

123456789101112131415161718
  1. /* syntax version 1 */
  2. select
  3. DateTime::MakeDate(DateTime::Split(`date`)) as rdate,
  4. DateTime::MakeDatetime(DateTime::Split(`datetime`)) as rdatetime,
  5. DateTime::MakeTimestamp(DateTime::Split(`timestamp`)) as rtimestamp,
  6. DateTime::MakeTzDate(DateTime::Split(`tzdate`)) as rtzdate,
  7. DateTime::MakeTzDatetime(DateTime::Split(`tzdatetime`)) as rtzdatetime,
  8. DateTime::MakeTzTimestamp(DateTime::Split(`tztimestamp`)) as rtztimestamp
  9. from (
  10. select
  11. cast(fdate as Date) as `date`,
  12. cast(fdatetime as Datetime) as `datetime`,
  13. cast(ftimestamp as Timestamp) as `timestamp`,
  14. cast(ftzdate as TzDate) as `tzdate`,
  15. cast(ftzdatetime as TzDatetime) as `tzdatetime`,
  16. cast(ftztimestamp as TzTimestamp) as `tztimestamp`
  17. from Input
  18. );