Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Similar to alias, but to be reusable in all clauses of SQL: SELECT

Re: Similar to alias, but to be reusable in all clauses of SQL: SELECT

From: sybrandb <sybrandb_at_gmail.com>
Date: 17 Jan 2007 06:42:31 -0800
Message-ID: <1169044951.917604.176730@51g2000cwl.googlegroups.com>

On Jan 17, 3:30 pm, qazmlp1..._at_rediffmail.com wrote:
> I have to use only a converted form of a column value (E.g.
> SUBSTR(TO_CHAR(my_function(Column-1)),1,17))) in all the clauses of my
> SQL statement i.e. where, having, group by, order by clauses.
> The statement looks ugly if I put the samething in al the places. How
> can I make it to mention in only one place, so that I can reuse it in
> other parts of the SQL statement. I suppose I cannot use the column
> alias as it can be reused only at the Order by clause.
>
> A quick look at the PL/SQL tutorial did not fetch me anything related
> to it. Can anybody help here?

No version again. If you want to force this forum to do your work, could you at least post a version? You know that string of 5 digits and 3 dots.

Other than that for 9i and higher look up the WITH statement.

-- 
Sybrand Bakker
Senior Oracle DBA
Received on Wed Jan 17 2007 - 08:42:31 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US