Home » SQL & PL/SQL » SQL & PL/SQL » using AND conditon in select statement
using AND conditon in select statement [message #433779] Fri, 04 December 2009 04:30 Go to next message
mohan1760
Messages: 59
Registered: June 2008
Member
CHARGE_CODE= MY and the DERIVATION_INDICATOR=P

I want to use above conditon in select
statement .


like

select decode(charge_code,'MY' and DERIVATION_INDICATOR=P....)
from abc

something like this....or using any other function.


thanks in advance

Re: using AND conditon in select statement [message #433781 is a reply to message #433779] Fri, 04 December 2009 04:34 Go to previous messageGo to next message
Its_me_ved
Messages: 979
Registered: October 2009
Location: India
Senior Member
Search for CASE keyword ..
select case when (dummy='X' and 1=1 ) then 'T' else 'F' end result from dual;


By the way
CHARGE_CODE= MY and  DERIVATION_INDICATOR=P

should be
CHARGE_CODE= 'MY' and  DERIVATION_INDICATOR='P'

[Updated on: Fri, 04 December 2009 04:41]

Report message to a moderator

Re: using AND conditon in select statement [message #433798 is a reply to message #433781] Fri, 04 December 2009 05:30 Go to previous message
mohan1760
Messages: 59
Registered: June 2008
Member
thank u very much..
Previous Topic: question regarding the data type
Next Topic: Update table runs too low. Please help
Goto Forum:
  


Current Time: Tue Sep 27 17:55:36 CDT 2016

Total time taken to generate the page: 0.11914 seconds