Steven
Steven

Reputation: 13769

Evaluate Oracle Expression

As I learn new features in Oracle, sometimes I want to test how a function or type conversion works.

Is there a quick way to evaluate a literal expression without querying a table?

For example, if I wanted to see how date arithmetic worked, I might construct the following query:

SELECT SYSDATE - 1 as dateMinusLiteral, TRUNC(SYSDATE) midnight
  FROM sample
 WHERE sample_id=1

However, all I want is to see how Oracle evaluates the expressions, not perform the calculation on each row.

Suggestions?

Upvotes: 0

Views: 344

Answers (1)

Quassnoi
Quassnoi

Reputation: 425371

SELECT  SYSDATE - 1 as dateMinusLiteral, TRUNC(SYSDATE) midnight
FROM    dual

Upvotes: 5

Related Questions