Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using Wildcard in a CASE statement. Syntax query

438019Feb 9 2005 — edited Feb 9 2005
Hi,

I can't seem to get this case statement to work In Oracle 9i. I want to query a column using WILDCARDS

This works fine
SELECT "SURNAME",
CASE "SURNAME"
WHEN 'FLEMING' then "SURNAME"
END "MATCH"
FROM BASICVIEW;

When I add the Wildcards I get an invalid SQL statement message
SELECT "SURNAME",
CASE "SURNAME"
WHEN LIKE '%FLEMING%' then "SURNAME"
END "MATCH"
FROM BASICVIEW;

What is the correct syntax for using wildcards in SELECT statements (I've tried loads of different permutations)?

Thanks lots
Mark
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 9 2005
Added on Feb 9 2005
4 comments
4,584 views