I tried the following code and it did not work:
select case when vendor_code = 1 then 'One' when vendor_code = 2
then 'Two' else 'Whatever' end from sites
and
select case when vendor_code = 1 then result('One') when vendor_code = 2
then result('Two') else result('Whatever') end from sites
I did not see the CASE statement as an option in the Oracle book
I have or the on-line docs. The above code was run directly from
T.O.A.D. (interactive tool for Orcale developers). The error message
I get is: ORA00923 - FROM keyword not found where expected...
>Tom,
>
>SELECT case when search-condition(1) then result(1) ;
> when search-condition(2) then result(2) ;
> else result(x) end ;
> FROM Table
>
>(courtesy of Stephen Russell
>Memphis Visual FoxPro user Group)
>
>
>
>
>>Is there a function in Oracle that emulates what
>>the VFP IIF() function does? The closest thing
>>I have seen is the DECODE() function.
>>
>>What I need to do is as follows in a SQL passthru statement:
>>
>>IIF(num_trys > max_trys, 'True', 'False') AS fieldname
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement