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!

How to handle special character in IN clause

Orcl ApexApr 21 2022 — edited Apr 21 2022

Hi All,
I have data like the below in a table column and I want to write a query to fetch rows like below but it always asks me to enter the value for B. Could you please suggest how I can write it in IN clause?

WITH t AS (SELECT 'A:B' c FROM DUAL UNION ALL
           SELECT 'A&B' c FROM DUAL UNION ALL
           SELECT 'AB' c FROM DUAL UNION ALL
          )
SELECT * FROM t
WHERE c IN ('A:B', 'AB', 'A&B');


Comments
Post Details
Added on Apr 21 2022
5 comments
622 views