如何将这个postgres sql查询写入oracle?

时间:2014-04-07 05:59:05

标签: sql oracle postgresql

以下是我使用的postgres SQL查询。我需要将此查询更改为在Oracle中运行。

SELECT DISTINCT d.id,
                d.title,
                d.entityname,
                d.abstract,
                d.url,
                d.ranking,
                d.forwardemail,
                d.technologyclass,
                d.technology,
                d.product,
                d.technologytype,
                d.comments,
                d.status,
                d.year,
                d.day,
                d.month,
                d.entitytype,
                d.entitysource,
                d.chapter,
                d.country,
                d.region,
                d.address
FROM   research_data d
WHERE  d.status = 'A'
       AND d.id IN(SELECT e.parent_id
                   FROM   research_data_history e
                   WHERE  e.changed_date::DATE = To_date('02-01-13', 'MM-DD-YY')) 

1 个答案:

答案 0 :(得分:1)

你有什么尝试?在Oracle中运行它时是否收到错误?您只需要从子选择中删除:: DATE。

SELECT
  e.parent_id
FROM
  research_data_history e
WHERE
  e.changed_date = to_date('02-01-13', 'MM-DD-YY')