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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Computing on column and where?

Re: Computing on column and where?

From: Brian Peasland <peasland_at_edcmail.cr.usgs.gov>
Date: Wed, 8 Mar 2000 13:52:22 GMT
Message-ID: <38C65B16.CC905C32@edcmail.cr.usgs.gov>


> I am having difficulty with the following scenario:
> select a, b, (c + (select otherColumn from otherTable where otherClause)
> from mainTable where 3 >= value order by 3
>
> Basically, I want to perform some calculation on a column of a table,
> use the computed value in the where clause, and return the computed
> value.

Kurt,

   I'm not sure if I understand what you are looking for. Does the '3' in your where clause mean the 3rd column? Does your subquery return one row, or multiple rows?

You can try:

   SELECT a,b,c + otherColumn
   FROM mainTable, (SELECT otherColumn FROM otherTable WHERE otherClause)

   WHERE c+otherColumn >= value
   ORDER BY 3; I'm not sure if it will work, but it's worth a shot.

HTH,
Brian

--



Brian Peasland
Raytheons Systems at
  USGS EROS Data Center
These opinions are my own and do not
necessarily reflect the opinions of my company!
Received on Wed Mar 08 2000 - 07:52:22 CST

Original text of this message

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