Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Partial string comparison in DECODE ?
I am trying to create a DECODE statement to replicate some formulas I developed
in Crystal reports,( I want to create a view that includes the resulting values)
so I need to create a DECODE statement that is equivalent to:
if dept_nbr like 'T791%' then 'Management' else if dept_nbr like 'T792%' then 'Second Level' else if dept_nbr like 'T7922%' then 'Second_sub Level2' .....etc ( These are examples, not real , so ignore logic ) In other words, the 'comparison part' may be the first 2 or 3 or 4 or 5 or 6 characters in the field...
It appears that wild cards are not allowed in the DECODE expression, so any ideas ?
Thanks,
John Greco
PS: ( Oracle 7.3.4, Netware 4.11,)
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==---------- http://www.newsfeeds.com The Largest Usenet Servers in the World! ------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==----- Received on Tue Oct 19 1999 - 10:35:14 CDT