Using Wildcards % with When, Then and else.

How would I format this so I can use wildcards in the criteria I am searching for. If want to be able to use % at the end

,CASE  prc.prc_abbr                                                
WHEN 'CDTAV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
WHEN 'LANGTAV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
WHEN 'MHTAV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
WHEN 'PHONE%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
WHEN 'PNTAV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
WHEN 'TAV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
WHEN 'ESVV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
WHEN 'LANGVID%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
WHEN 'OBVV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
WHEN 'VAV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
ELSE 'No Visit Type'
END AS "Enc_Name-Visit_Type"
Culwatrnca11Data AnalystAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
Try it this way

CASE                                                  
 WHEN  prc.prc_abbr  LIKE  'CDTAV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
 WHEN prc.prc_abbr  LIKE  'LANGTAV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
 WHEN prc.prc_abbr  LIKE  'MHTAV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
 WHEN prc.prc_abbr  LIKE  'PHONE%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
 WHEN prc.prc_abbr  LIKE  'PNTAV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
 WHEN prc.prc_abbr  LIKE  'TAV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
 WHEN prc.prc_abbr  LIKE  'ESVV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
 WHEN prc.prc_abbr  LIKE  'LANGVID%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
 WHEN prc.prc_abbr  LIKE  'OBVV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
 WHEN prc.prc_abbr  LIKE  'VAV%' THEN  prc.prc_name || ' ---> ' || prc.prc_abbr
 ELSE 'No Visit Type'
 END AS "Enc_Name-Visit_Type" 

Open in new window


Are you using that in the selection criteria or as part of the query?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Culwatrnca11Data AnalystAuthor Commented:
Its in the select area
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Teradata

From novice to tech pro — start learning today.