Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

case construct in where clause

where 
case when slogic = 'begins' and partnum like sPartStrp||'%' 
     then 1
     when slogic = 'contains' and partnum like '%'||spartStrp||'%'
     then 1
     when slogic = 'equals' and partnum = sPartStrp
     then 1
     when partnum like sPartStrp || '%' 
     then 1
     else 0
 end = 1
and p.stock_type = 1
Source by asktom.oracle.com #
 
PREVIOUS NEXT
Tagged: #case #construct #clause
ADD COMMENT
Topic
Name
4+3 =