Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

INTERVAL DAY TO SECOND comparison in SELECT.

Marius2Oct 27 2006 — edited Oct 27 2006
I would like to to a comparison like this in the select statement:

If interval_a > interval b THEN return_a ELSE return_b.

My only idea was:
SELECT CASE SIGN(interval_a-interval_b) WHEN 1 THEN return_a ELSE return_b END
*
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected NUMBER got INTERVAL DAY TO SECOND

Any easy solution to this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 24 2006
Added on Oct 27 2006
3 comments
341 views