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!

common subexpression elimination in SELECT clauses

user10936714Aug 19 2010 — edited Aug 19 2010
Hi,

Is there a way to avoid re-writing common sub-expressions in SELECTs?

For instance, suppose you have:
SELECT ...complex expression..., ...same complex expression...+1
FROM ...
This could be written as a nested SELECT:
SELECT x.value, x.value+1
FROM
  (SELECT ...complex expression... value FROM ...) x
Are there any other techniques available?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 16 2010
Added on Aug 19 2010
7 comments
1,293 views