Sokrates on Oracle

world clock

Posted by Matthias Rogel on 28. September 2011

with z as (
  select
  distinct
     tn.tzname as "timezone",
     cast(
        from_tz(
           cast(sysdate as timestamp),
           dbtimezone
        ) at time zone tn.tzname
        as date
     ) as "time there"
  from V$TIMEZONE_NAMES tn
)
select
   "time there",
   listagg("timezone", ', ') within group (order by "timezone") as "where"
from z
group by "time there"
order by "time there"
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: