I am posting a part of my query which is in Oracle and it as follows:
cast(from_tz(cast((Select max(d.startdate) from Public.result_slalom d
where d.eventid = a.eventid
and d.modifydate = (Select max(e.modifydate) from result_slalom e
where e.eventid = d.eventid)) as timestamp), 'Asia/Calcutta') at Time Zone 'Europe/Berlin' as date) as OpenLastTime,
I want to run this query on PostgreSQL. So I wrote a query which looks like this for PostgreSQL:
(Select Cast(to_timestamp(max(d.startdate))
from Public.result_slalom d
where d.eventid = a.eventid
and d.modifydate = (Select max(e.modifydate) from Public.result_slalom e
where e.eventid = d.eventid) as timestamp, 'Asia/Calcutta') at Time Zone 'Europe/Berlin' as date) as OpenLastTime,
I am getting a few errors here and there, which I believe are related to some bracket issues. Or due to the keyword 'timestamp' in the second select clause for e.modifydate.
Any help would be much appreciated. Thanks in advance. :)