1

I'm getting a "missing right parenthesis" error with the below query. I do not have a missing parenthesis....

I tried looking at the oracle sql documentation and do not see where there is an issue.

The query is

select *
  from DB.DB
 where OUTAGE_OPENED > DATE_SUB(NOW(), INTERVAL 60 MINUTE)

The full error is

ORA-00907: missing right parenthesis 00907. 00000 - "missing right parenthesis" *Cause:
*Action: Error at Line: 25 Column: 48

Column 48 is where I have the 60.

I've tried SUBDATE(the documentation says they are the same when using the arguments I am using). This works in mysql, and it seems like it should work in oracle, but obviously I'm doing something wrong.

2 Answers 2

3

date_sub() is not an Oracle function. Just use intervals:

SELECT * 
FROM DB.DB
WHERE OUTAGE_OPENED > sysdate - INTERVAL '60' MINUTE;
Sign up to request clarification or add additional context in comments.

Comments

0

DATE_SUB is available in MySQL but not in Oracle. Although both of these databases are Oracle Corporation products (now) they are the results of completely different development lines (you might compare the history of both products) and thus have major differences, such as their handling of dates and times.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.