Re: CASE Statement
Date: Tue, 24 Jun 2008 07:30:51 -0700 (PDT)
On Jun 24, 7:14 am, Mtek <m..._at_mtekusa.com> wrote:
> I know I can probably do this in an IF statement(s). But, I was
> wondering if you can have a query with a CASE in it, and later in the
> query refer to a value eariler in the query.
> My guess is no, but if I case column 1, and column 2 is based on the
> value derived from the case of column 1, and so on, is that easily
> If not, it is onto putting it in the code......
You can try using an inline view containing column 1, using its value in the outer query to formulate column 2. Something like this:
select case col1 when....end as column_2,
from ( select case table.column when ... end as column_1
from ... )
Vince Received on Tue Jun 24 2008 - 09:30:51 CDT